更新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