Joined December 2018
·

internetross

·

Posted to Get git current branch name over 1 year ago

For other folks arriving here from a google search, as of Git 1.8.1 you can do git symbolic-ref --short HEAD to get the current branch name. This may be considered more idiomatic since the docs (https://git-scm.com/docs/git-symbolic-ref) mention using this command for that use case: "Typically you would give HEAD as the <name> argument to see which branch your working tree is on."

Achievements
1 Karma
0 Total ProTip Views