0

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 ?

3 Answers 3

1

git branch -r will list all remote-tracking branches that exist in your local repository:

$ git branch -r origin/HEAD -> origin/master origin/master 

You can also use the -a option to get all branches that exist in your local repository:

$ git branch -a * master remotes/origin/HEAD -> origin/master remotes/origin/master 
Sign up to request clarification or add additional context in comments.

Comments

0

The -a option to git branch will list all remote-tracking branches. This is mentioned in the manual page.

Comments

0

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.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.