Skip to content

Instantly share code, notes, and snippets.

@kalupa
Created July 30, 2011 07:48
Show Gist options
  • Save kalupa/1115311 to your computer and use it in GitHub Desktop.
Save kalupa/1115311 to your computer and use it in GitHub Desktop.
function parse_git_branch {
ref=$(git symbolic-ref HEAD 2> /dev/null) || return
echo "("${ref#refs/heads/}")"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment