Get List of all local branches git command


In order to find out the list of all local branches of your project make use of the git branch command,

Example:
% git branch

  feature/JIRA-1
  feature/JIRA-B
* master
  main
  release
Git Branch command to list all local branches
Git List of all Local Branches

As in the above example, you do not need to pass any options, all the branches that are available locally will be displayed in alphabetical order with an asterisk (*) in front of the current branch that you are on.

✌️Press the q button to come back to the shell from the list branch results.

Advertisements
Try Out Code2care Dev Tools:

Advertisements

Advertisements
Code2care is an initiative to publish and share varied knowledge in programming and technical areas gathered during day-to-day learnings and development activities.

Students and software developers can leverage this portal to find solutions to their various queries without re-inventing the wheel by referring to our easy to understand posts. Technical posts might include learnings, tutorials, trouble-shooting steps, video tutorials, code snippets, how-to, blogs, articles, etc.

🎉 We are celebrating the 10th years of Code2care! Thank you for all your support!

We strongly support Gender Equality & Diversity.