有时候git会在没有我要求的情况下将所有远程git分支作为本地分支进行跟踪。发生了什么? [英] Sometimes git will track all remote git branches as local branches without me asking to. What happened?
本文介绍了有时候git会在没有我要求的情况下将所有远程git分支作为本地分支进行跟踪。发生了什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
解决方案
如果您只是从远程分支执行普通分支,默认情况下:
git checkout -b somebranch origin / somebranch
的含义与
git checkout -t origin / somebranch
如果您不想要这样的跟踪,您几乎必须明确地告诉它。 / p>
sometimes, git will spontaneously (during some, but not all, "pull" or "clone" operations) copy all of the remote branches of a repository into my local repository (and even set them all up to track the corresponding remote branches correctly). What causes this? Is there a way I can do this on purpose?
解决方案
If you just do a normal branch from a remote branch, it'll track by default:
git checkout -b somebranch origin/somebranch
means roughly the same thing as
git checkout -t origin/somebranch
You pretty much have to explicitly tell it if you don't want such tracking.
这篇关于有时候git会在没有我要求的情况下将所有远程git分支作为本地分支进行跟踪。发生了什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文