我有本地分支'master'和vam-master',它们分别跟踪远程分支'application / master'和'application / vam-master'。
$ git branch -a
* master
vam-master
remotes/application/master
remotes/application/pvm-master
$ git branch -r
m/ds-2.3.1_r1 -> application/master
application/master
application/vam-master
但由于某种原因,现在'vam-master'正在跟踪'application / master',而不是'application / vam-master'。我该如何解决? 当我做'git status'时,我得到:
$ git checkout vam-master
Switched to branch 'vam-master'
Your branch and 'application/master' have diverged,
and have 49 and 13 different commit(s) each, respectively.
谢谢。
答案 0 :(得分:1)
git branch --set-upstream vam-master application/vam-master
git branch --set-upstream master application/master
应该做的伎俩。另请参见git branch
的手册页。
另一个选项(不那么优雅)是编辑.git/config
并更正那里的条目。