Using -a
with git branch
The -a
flag in the git branch
command stands for “all”. When you use git branch -a
, it lists all branches in your repository, including remote branches.
In simpler terms, without the -a
flag, git branch
only displays the local branches. However, if you add the -a
flag, it also shows branches that exist on remote repositories (like branches on GitHub or GitLab). This can be useful when you want to see the full picture of all available branches, both local and remote.
Here’s how you use it:
git branch -a
The output list all branches, providing an inclusive view of your project’s branches.