更新GitHub项目出现There is no tracking information for the current branch. Please specify which branch you want to merge with. 怎么解决


git pull命令用于从另一个存储库或本地分支获取并集成(整合)。git pull命令的作用是:取回远程主机某个分支的更新,再与本地的指定分支合并,它的完整格式稍稍有点复杂。

如果当前分支只有一个追踪分支,连远程主机名都可以省略。

$ git pull

上面命令表示,当前分支自动与唯一一个追踪分支进行合并。

 

当出现上面的情况时,我们可以有两种解决方法

对于这种情况有两种解决办法,就比如说要操作master吧,一种是直接指定远程master:

git pull origin master

 

另外一种方法就是先指定本地master到远程的master,然后再去pull:

git branch --set-upstream-to=origin/master master
git pull

这样就不会再出现“There is no tracking information for the current branch”这样的提示了。


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM