How to List All Remote Branches in Git

John John (304)
2 minutes

This short guide will show you how to list all remote branches in Git. Visit this guide for steps on how to check out a remote branch.

Posted in these interests:
h/git16 guides
h/webdev60 guides
h/programming8 guides

In your repo directory, type:

git branch -a

This will render a list of all available remote branches. The -a flag means "all".

To learn more about git branch and its available flags and options, see the git branch documentation.

John John (304)
2 minutes

Sometimes we start writing code without managing our branches in advance. Then we make commits in master (or some other base branch) when we intended to carve off a new feature branch.