git-branch --print-current
- From
- Karl Chen <quarl@cs.berkeley.edu>
- Date
- Jan 2, 2009, 03:28 UTC
- Message-ID
- <quack.20090101T1928.lthzliaqtdf@roar.cs.berkeley.edu>
How about an option to git-branch that just prints the name of the current branch for scripts' sake? To replace:
git branch --no-color 2>/dev/null | perl -ne '/^[*] (.*)/ && print $1'