/ 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
Copy this code and paste it in your HTML
branch=$( git branch 2>/dev/null|grep -e ^* | tr -d \*\ )
Comments
