Skip to content

Instantly share code, notes, and snippets.

@mjdominus
Created January 4, 2012 15:22
Show Gist options
  • Save mjdominus/1560515 to your computer and use it in GitHub Desktop.
Save mjdominus/1560515 to your computer and use it in GitHub Desktop.
git name-rev --name-only doesn't get the name of the current branch
$ git branch
master
* snonk
$ git rev-parse master snonk
1333053e19b35008e74476b1549ecfed709c3d44
1333053e19b35008e74476b1549ecfed709c3d44
$ git name-rev --name-only HEAD
master
$ git rev-parse --symbolic-full-name --abbrev-ref HEAD
snonk
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment