Git List Branches – How To Show All Remote And Local Branch Names

Search Submit your search query freeCodeCamp.org Menu Menu Donate Kolade Chris Kolade Chris
Git List Branches – How to Show All Remote and Local Branch Names

Git is a version control system used by software developers to track changes in applications and collaborate on projects.

One feature that makes Git more dynamic is branches. Developers working on a project can work in different branches before merging their changes with the original code or the main branch.

Sometimes, you might want to see the branches you and other collaborators have created. And that’s what I’m going to show you how to do in this article.

How to Show All Remote and Local Branch Names

To see local branch names, open your terminal and run git branch: ss-1-4

N.B the current local branch will be marked with an asterisk. In addition, if you’re using Git bash or WSL’s Ubuntu as your terminal, the current local branch will be highlighted in green.

To see all remote branch names, run git branch -r: ss-2-4

To see all local and remote branches, run git branch -a: ss3

You can see detailed information such as the local or remote branches in use, commit ids, and commit messages by running git branch -vv or git branch -vva: ss4

Conclusion

This article showed you how to list branches while working with Git.

Being able to list the Git branches of a project can help you learn more about the project and get to know what your team members are working on.

If you find this article helpful, don’t hesitate to share it with others who might need it.

Thank you for reading.

Kolade Chris Kolade Chris

I'm a software developer and tech writer focusing on frontend technologies

If you read this far, thank the author to show them you care. Say Thanks

Learn to code for free. freeCodeCamp's open source curriculum has helped more than 40,000 people get jobs as developers. Get started

ADVERTISEMENT

Tag » All Git Branches