我试过了git branch -r
,但这仅列出我在本地跟踪的远程分支。如何找到我没有的列表? (命令是否列出对我来说并不重要all远程分支或仅那些未跟踪的分支。)
For the vast majority[1] of visitors here, the correct and simplest answer to the question https://stackoverflow.com/questions/3471827/how-do-i-list-all-remote-branches-in-git-1-7#comment39347566_3472296 "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
不起作用,那么也许是Cascabel https://stackoverflow.com/users/119963/cascabel says “您已经修改了默认的参考规范,因此git fetch and git remote update不要获取所有remote的分支机构” https://stackoverflow.com/questions/3471827/how-do-i-list-all-remote-branches-in-git-1-7#comment3623773_3471827.
[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 https://stackoverflow.com/questions/3471827/how-do-i-list-all-remote-branches-in-git-1-7#comment39347566_3472296 out of 140 https://stackoverflow.com/questions/3471827/how-do-i-list-all-remote-branches-in-git-1-7#comment41488609_3472296).
If git branch -r
不起作用,检查git config --get remote.origin.fetch
包含通配符 (*
) 按照这个答案 https://stackoverflow.com/a/25941875/114770
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)