Get Current branch name in GIT

Generally there might be many branches inside a GIT repository and when you are working on multiple repositories you might know which branch you are currently working on. So there are 2 ways to find out which branch you are currently working on. let us see them below

1st way: The below command will list the branches you are working on and current branch would be highlighted as shown in the picture below


git branch

2nd way : This is one of the workaround ways where you can checkout to main branch and then switch to the branch you are working. This is advisable when you don’t remember the commands to see the branch you are working on.

Scroll to Top