For the vast majority[1] of visitors here, the correct and simplest answer to the question “How do I list all remote branches in Git 1.7+?” is:
git branch -r
For a small minority[1] git branch -r
does not work. If git branch -r
does not work try:
git ls-remote --heads <remote-name>
If git branch -r
does not work, then maybe as Cascabel says “you’ve modified the default refspec, so that git fetch
and git remote update
don’t fetch all the remote
‘s branches”.
[1] As of the writing of this footnote 2018-Feb, I looked at the comments and see that the git branch -r
works for the vast majority (about 90% or 125 out of 140).
If git branch -r
does not work, check git config --get remote.origin.fetch
contains a wildcard (*
) as per this answer
Related Posts:
- How to fetch all Git branches
- How to fetch all Git branches
- How to remove local (untracked) files from the current Git working tree
- Git fetch remote branch
- Git fetch remote branch
- How to get the current branch name in Git?
- How do you create a remote Git branch?
- Make an existing Git branch track a remote branch?
- How to get the current branch name in Git?
- How do you create a remote Git branch?
- Branch from a previous commit using Git
- Git pull origin
overwrites master? - How to clone all remote branches in Git
- Git: Merge a Remote branch locally
- How do I run git log to see changes only for a specific branch?
- How do I delete a Git branch locally and remotely?
- How do I delete a Git branch locally and remotely?
- How do I rename a local Git branch?
- What is the best (and safest) way to merge a Git branch into master?
- How do I rename a local Git branch?
- Git merge hotfix branch into feature branch
- How do I clone a specific Git branch? [duplicate]
- How do I push a new local branch to a remote Git repository and track it too?
- How do I push a new local branch to a remote Git repository and track it too?
- How do I push a new local branch to a remote Git repository and track it too?
- How to get just one file from another branch?
- Update Git branches from master
- Create a branch in Git from another branch
- How do I rename both a Git local and remote branch name?
- Create Git branch with current changes
- What are the differences between git remote prune, git prune, git fetch –prune, etc
- Why do I have to “git push –set-upstream origin
“? - Move the most recent commit(s) to a new branch with Git
- How to pull a specific branch from Github
- Move the most recent commit(s) to a new branch with Git
- How do I call git diff on the same file between 2 different local branches?
- Why do I have to “git push –set-upstream origin
“? - master branch and ‘origin/master’ have diverged, how to ‘undiverge’ branches’?
- git pull from master into the development branch
- Not a valid object name: ‘master’
- Your configuration specifies to merge with the
from the remote, but no such ref was fetched.? - How can I copy the content of a branch to a new local branch?
- How do I copy a version of a single file from one Git branch to another?
- Set up git to pull and push all branches
- Update Git branches from master
- Move existing, uncommitted work to a new branch in Git
- How do I clone a single branch in Git?
- how to reset develop branch to master
- Delete branches in Bitbucket
- How do I push a local Git branch to master branch in the remote?
- How to keep a branch synchronized/updated with master?
- Rebasing remote branches in Git
- How to create a local branch from an existing remote branch?
- How can I delete all Git branches which have been merged?
- How can I display the current branch and folder path in terminal?
- How to find which git branch I am on when my disk is mounted on other server
- How to create a new branch from a tag?
- Git refusing to merge unrelated histories on rebase
- What is the difference between git push origin and git push origin master
- git error: failed to push some refs to remote
- git – remote add origin vs remote set-url origin
- Git: Message ‘src refspec master does not match any’ when pushing commits in Git
- How to upgrade Git on Windows to the latest version
- Need to reset git branch to origin version
- Git: How to solve Permission denied (publickey) error when using Git?
- How do I ignore an error on ‘git pull’ about my local changes would be overwritten by merge?
- Stash only one file out of multiple files that have changed with Git?
- What is git fast-forwarding? [duplicate]
- fatal: The current branch master has no upstream branch
- Heroku: “No default language could be detected for this app” error thrown for node app
- How to cherry-pick multiple commits
- Git master branch has no upstream branch
- Reset local repository branch to be just like remote repository HEAD
- What is “origin” in Git?
- How can I make Git “forget” about a file that was tracked, but is now in .gitignore?
- How to remove files from git staging area?
- How do I ignore an error on ‘git pull’ about my local changes would be overwritten by merge?
- How to undo git reset –soft to get my changes back?
- .gitignore and “The following untracked working tree files would be overwritten by checkout”
- git – Your branch is ahead of ‘origin/master’ by 1 commit
- How to remove a directory from git repository?
- git add . -> still “nothing to commit” with new files
- git submodule add error: does not have a commit checked out
- Can I delete a git commit but keep the changes?
- Git: How to update/checkout a single file from remote origin master?
- docker error : the input device is not a TTY. If you are using mintty, try prefixing the command with ‘winpty’
- How do you clone a Git repository into a specific folder?
- How to have ‘git log’ show filenames like ‘svn log -v’
- How can I see the changes in a Git commit?
- Python way to clone a git repository
- Git removing upstream from local repository
- Git pull – Please move or remove them before you can merge
- Unlink of file Failed. Should I try again?
- Change the location of the ~ directory in a Windows install of Git Bash
- [npm notice created a lockfile as package-lock.json. You should commit this file
- Different color admin bars for dev, staging and production
- best practice on pushing staging development (database/uploads) to the live server
- Tortoise SVN showing ‘Access to ‘/!svn/me” forbidden error.
- theme continuous deployment from bitbucket to windows azure
- how can I create a WP offline environment before releasing the websites? [closed]