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

Answer by Lawrence Paje for How to get the current branch name in Git?

$
0
0

git branch show current branch name only.

While git branch will show you all branches and highlight the current one with an asterisk, it can be too cumbersome when working with lots of branches.

To show only the branch you are currently on, use:

git rev-parse --abbrev-ref HEAD

Viewing all articles
Browse latest Browse all 96

Trending Articles



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