For the "get the name of the current branch" there's a git plumbing command that can help you get the current branch name reliably without the text manipulation:
alias git-branch="git rev-parse --abbrev-ref HEAD"
I tend to keep this one as part of my git aliases:
Nice post!
For the "get the name of the current branch" there's a git plumbing command that can help you get the current branch name reliably without the text manipulation:
I tend to keep this one as part of my git aliases:
Here's a quick write-up if you're interested!