I’ve tried git branch -r, but that only lists remote branches that I’ve tracked locally. How do I find the list of those that I haven’t? (It doesn’t matter to me whether the command lists all remote branches or only those that are untracked.)
I’ve tried git branch -r , but that only lists remote branches that I’ve
Share
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:
For a small minority[1]
git branch -rdoes not work. Ifgit branch -rdoes not work try:If
git branch -rdoes not work, then maybe as Cascabel says “you’ve modified the default refspec, so thatgit fetchandgit remote updatedon’t fetch all theremote‘s branches”.[1] As of the writing of this footnote 2018-Feb, I looked at the comments and see that the
git branch -rworks for the vast majority (about 90% or 125 out of 140).If
git branch -rdoes not work, checkgit config --get remote.origin.fetchcontains a wildcard (*) as per this answer