One of the most powerful features of Git is branches in a distributed way. Git provides local and remote branches for parallel application development. In this tutorial, we examine how to list or show remote branches by using different commands like
git branch ,
git ls-remote and
git remote show .
List Remote Branches with “git branch”
The official and most used command to list remote branches is the
git branch command. By default, the “git branch” command list all branches but the
-r option is provided in order to list only remote branches.
$ git branch -r
List Remote Branches with “git ls-remote”
If more detailed information about the remote branches is required the
git ls-remote command can be used. This command displays remote branches with lots of information and metadata.
$ git ls-remote
List Remote Branches with “git remote show”
Another command to list remote branches is the
git remove show . Generally, we need to list remote branches
origin so we use
git remote show origin to list remote branches and detailed information with URL information.
$ git remote show origin