git push時提示"fatal: The current branch master has no..."


git push到遠程倉庫時提示:fatal: The current branch master2 has no upstream branch. To push the current branch and set the remote as upstream,

use git push --set-upstream origin master2,如圖:

大意是當前分支與遠程分支沒有建立關聯,提示運行  git push --set-upstream origin master2 與遠程倉庫建立關聯,運行后即可通過 git push 推送成功,如果已在遠程github倉庫中手動建過同名的本地分支也可通過另一種方法,即:

git push <遠程主機名> <本地分支名>:<遠程分支名>,兩種方法如下:
一、 git push --set-upstream origin master2
二、 git push origin master2:master2

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM