i just want to list my local remote branches. but when i run git remote show origin
, it needs to take a request to the server. How can i do ?
How to list remote branch without web request?
126 views Asked by Link At
3
There are 3 answers
0
On
As mentioned above.
git branch -a
will display all your branches.
Important:
git branch -a
will indeed display the list of branches but those are the branched currently tracked under your .git
folder. As a best practice you should update your .git
folder before listing the branches.
The update is done using the git fetch --all --prune
The --all
will update all the branches and tags.
The --prune
will remove all the deleted branches.
git branch -r
will list all remote-tracking branches that exist in your local repository:You can also use the
-a
option to get all branches that exist in your local repository: