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