当前位置:   article > 正文

git push失败,提示fatal: The current branch master has no upstream branch.的解决办法_$ git push fatal: the current branch master has no

$ git push fatal: the current branch master has no upstream branch. to push

当项目完成想要将本地master推送到远端的码云,使用git push 提交时报错:

报错提示:没有将本地的分支与远程仓库的分支进行关联

fatal: 当前master分支 没有对应的上游分支。为推送当前分支并建立与远程上游的跟踪,使用 git push --set-upstream origin master

解决办法:按照提示,键入

git push --set-upstream origin master

这时出来一个新的错误:

出现错误的主要原因是gitee中的README.md文件不在本地代码目录中

此时我们要执行git pull --rebase origin master命令将README.md拉到本地,

然后执行git push origin master就可以成功了

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/繁依Fanyi0/article/detail/416123
推荐阅读
相关标签
  

闽ICP备14008679号