[英]How to correct the remote branch that my local branch is tracking?
我有本地分支“ 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.
謝謝。
git branch --set-upstream vam-master application/vam-master
git branch --set-upstream master application/master
應該做到的。 另請參見git branch
的手冊頁。
另一個選擇(不太優雅)是編輯.git/config
並更正那里的條目。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.