是&g; git branch -u(或--set-upstream-to)'丢失所有现有远程跟踪分支的跟踪信息?

时间:2015-07-29 13:02:24

标签: git git-remote git-track

我在我的主人'当我考虑创建一个新的分支并通过以下方式完成时分支:

$ git checkout -b od_newstructure
Switched to a new branch 'od_newstructure'

我提交了一些更改并将此新分支添加到远程并开始跟踪

$ git commit
$ git branch -u origin/od_newstructure
Branch od_newstructure set up to track remote branch od_newstructure from origin.
$ .. some other work including git pull and git push

我现在想切换回主人。所以我做了

git checkout master
Switched to branch 'master'

然而,师傅似乎不再追踪起源/主人了!

$ git branch -vv
* master          d1db2e3 Subdivided into several namespaces
  od_newstructure d1db2e3 [origin/od_newstructure] Subdivided into several namespaces

还通过git pull

进行了验证
$ git pull
There is no tracking information for the current branch.
Please specify which branch you want to merge with.
See git-pull(1) for details

我的问题是,当我切换到新的跟踪分支时,为什么以前的跟踪分支机构丢失了跟踪信息?这是默认和健全的行为吗?每次切换到跟踪分支时,是否必须按git branch -u添加上游?

0 个答案:

没有答案