Quantcast
Channel: How do I get the current branch name in Git? - Stack Overflow
Viewing all articles
Browse latest Browse all 96

Answer by Shakeel for How do I get the current branch name in Git?

$
0
0

A simple hack could be

git branch|grep "*"

Output:

* <current branch>

EDIT:

Another way to know current branch

git status|head -1On branch <current branch name>

Viewing all articles
Browse latest Browse all 96

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>