[Git] List branches

Created on November 28, 2026

You can list local branches with the git branch command.

git branch

Example output:

  feature/test
* master

The current branch is marked with *.

To list both local and remote-tracking branches, use the -a option.

git branch -a

To list only remote-tracking branches, use the -r option.

git branch -r

Remote-tracking branches record the state of remote branches locally. You can update them with git fetch.

References

Git