Skip to content

Instantly share code, notes, and snippets.

@reinh
Created January 21, 2009 18:55
Show Gist options
  • Save reinh/50111 to your computer and use it in GitHub Desktop.
Save reinh/50111 to your computer and use it in GitHub Desktop.
BR=$(git symbolif-ref HEAD 2> /dev/null || git name-rev HEAD 2> /dev/null || echo 'no branch')
BR=${BR#HEAD\ }
BR=${BR#refs/heads/}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment