Posted By

arunpjohny on 10/11/10



Versions (?)

How to get the current git branch

 / 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.

  1. branch=$( git branch 2>/dev/null|grep -e ^* | tr -d \*\ )

Report this snippet  

You need to login to post a comment.