/ Published in: Bash
![](/img/icon_sav.png?v3)
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
Copy this code and paste it in your HTML
branch=$( git branch 2>/dev/null|grep -e ^* | tr -d \*\ )
Comments
![RSS Feed for Comments RSS Icon](/images/rss.png?v3)