1.查看追踪关系,git branch -vv
$ git branch -vv
* master fe69429 [origin/master: ahead 11, behind 4] Merge branch 'zhangyi-dev'
zhangyi-dev 930cf95 [origin/zhangyi-dev] 解决冲突
上面可以看出:
master 分支跟踪 origin/master
zhangyi-dev 分支跟踪 origin/zhangyi-dev
2.设置追踪关系,如:本地名称为 master 要追踪到远程origin/
master,命令如下:
git branch --set-upstream-to=origin/master master