Skip to content

Instantly share code, notes, and snippets.

@nvkv
Created June 23, 2011 16:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nvkv/1042911 to your computer and use it in GitHub Desktop.
Save nvkv/1042911 to your computer and use it in GitHub Desktop.
Working branch extraction for my zsh theme
function git_prompt_info() {
branch=`(git branch | grep '*' | awk '{print $2}') 2> /dev/null`
if [ -z $branch ]; then
return
fi
echo "$ZSH_THEME_GIT_PROMPT_PREFIX${ref#refs/heads/}$branch$ZSH_THEME_GIT_PROMPT_SUFFIX"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment