This command provides a quick overview of all branches on remote repositories by listing them locally with the -r
flag.
It works by invoking the normal git branch
operation but filters the output to only show remote-tracking branches—-r
is shorthand for --remotes
, and each listed branch is prefixed with its remote name (for example, origin/main
).
Variations include using -a
(or --all
) to list both local and remote branches, adding -v
for verbose commit info, or combining flags like git branch -rv
. You can also use git remote show <remote>
to inspect branches on a specific remote.