Skip to content

Instantly share code, notes, and snippets.

@Cside
Created March 23, 2012 04:01
Show Gist options
  • Save Cside/2166630 to your computer and use it in GitHub Desktop.
Save Cside/2166630 to your computer and use it in GitHub Desktop.
get_git_branch_name.zsh
#!zsh
function git_info() {
local info
if test -z $(git rev-parse --git-dir 2> /dev/null); then
info=''
else
info="${$(git symbolic-ref HEAD 2> /dev/null)#refs/heads/}"
fi
echo -n "$info"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment