上傳至gitlab—— 本地git出現fatal: The current branch develop has no upstream branch. To push the current branch and set the remote as upstream, use git push --set-upstream origin develop 的問題


git 發生:

fatal: The current branch develop has no upstream branch.
To push the current branch and set the remote as upstream, use

git push --set-upstream origin develop

具體fatal錯誤如圖:

這個錯誤就是 表示本地分支與遠程分支之間沒有連接起來。

解決方法:只需要在輸入 git push -u origin develop(這個develop是遠程分支名), 因為本身我就在本地的develop分支上面,所以可以直接 push,如下圖,成功。如果本地不在develop分支上,可以先git checkout develop切換分支至本地develop分支再執行剛才那條推送命令推至遠程develop分支。

參考:https://blog.csdn.net/weixin_44514665/article/details/91956785


免責聲明!

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



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