Git 是否';吉特分行-u(或-设置为上游)和#x27;是否丢失所有现有远程跟踪分支的跟踪信息?

Git 是否';吉特分行-u(或-设置为上游)和#x27;是否丢失所有现有远程跟踪分支的跟踪信息?,git,git-remote,git-track,Git,Git Remote,Git Track,当我想到创建一个新分支时,我在我的“主”分支中,并通过以下方式实现了这一点: $ git checkout -b od_newstructure Switched to a new branch 'od_newstructure' 我提交了一些更改,并将这个新分支添加到remote并开始跟踪 $ git commit $ git branch -u origin/od_newstructure Branch od_newstructure set up to track remote bran

当我想到创建一个新分支时,我在我的“主”分支中,并通过以下方式实现了这一点:

$ git checkout -b od_newstructure
Switched to a new branch 'od_newstructure'
我提交了一些更改,并将这个新分支添加到remote并开始跟踪

$ 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
我现在想切换回master。所以我做了

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
添加上游?

您使用的是哪个版本的git?您能否尝试使用更新的git,以查看问题是否仍然存在?我在MacOS上遇到了相同的问题git版本2.6.3