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
The accepted answer works for me. But I found it more useful to have the commits sorted starting with the most recent.
git branch -r --sort=-committerdate
https://git-scm.com/docs/git-branch
If there's a remote branch that you know should be listed, but it isn't getting listed, you might want to verify that your origin is set up properly with this:
git remote show origin
If that's all good, maybe you should run an update:
git remote update
Assuming that runs successfully, you should be able to do what the other answers say:
git branch -r
Using git branch -r
lists all remote branches and git branch -a
lists all branches on local and remote. These lists get outdated though. To keep these lists up-to-date, run
git remote update --prune
which will update your local branch list with all new ones from the remote and remove any that are no longer there. Running this update command without the --prune will retrieve new branches but not delete ones no longer on the remote.
You can speed up this update by specifying a remote, otherwise it will pull updates from all remotes you have added, like so
git remote update --prune origin
You also may do git fetch
followed by a git branch -r
. Without fetch you will not see the most current branches.
Try this...
git fetch origin
git branch -a
But
git branch -ar
should do it.