git pull : git 本地分支和远程分支联系 Threre is no tracking information for the current branch

git 本地分支和远程分支联系 Threre is no tracking information for the current branch

解决在通过git客户端 git pull的时候出现

Threre is no tracking information for the current branch . Please specify which branch you want to merge with。

 

引起的原因可能是同事a误建了一个分支,后来删除了,但是在本地没有删除该分支,还有该分支的记录。

同事b新建了该分支,并写了些业务,这时同事a想看同事b代码时pull出现的报错。

 

新建本地分之后将本地分支推送到远程库,使用git pull或者push时候报错

 

是因为本地分支和远程分支没有建立联系 (使用git branch -vv 可以查看本地分支和远程分支的关联关系) .根据命令行提示只需要执行以下命令即可

git branch --set-upstream-to=origin/远程分支的名字 本地分支的名字 

  

posted @ 2022-04-07 17:57  IT6889  阅读(57)  评论(0编辑  收藏  举报