git push之后報錯 fatal: The current branch dev has no upstream branch. To push the current branch and set the remote as upstream, use git push --set-upstream origin dev


git push之后報錯

fatal: The current branch dev_22_05-mcx has no upstream branch.
To push the current branch and set the remote as upstream, use
    git push --set-upstream origin dev_22_05-mcx

原因:

新建的本地 dev 分支沒有和遠程的 dev 分支相關聯。

解決辦法一:

執行 git push -u origin dev(遠程分支名),建立遠程分支 dev 然后關聯本地 dev 和遠程 dev,若當前不在 dev 分支,則需先執行 git checkout dev 切換到 dev 分支,然后在執行 上述命令。

解決方法二:

按照提示執行 git push --set-upstream origin dev 將本地 dev 和遠程 dev 分支相關聯,然后再執行 git push 即可。

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


免責聲明!

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



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