/ Published in: Bash
git branch will give us all the branches in the current repository and the current branch will be denoted by a * mark.
Expand |
Embed | Plain Text
branch=$( git branch 2>/dev/null|grep -e ^* | tr -d \*\ )
You need to login to post a comment.
