admin管理员组文章数量:1612060
问题
$ git push --force
fatal: The upstream branch of your current branch does not match
the name of your current branch. To push to the upstream branch
on the remote, use
git push origin HEAD:master
To push to the branch of the same name on the remote, use
git push origin HEAD
To choose either option permanently, see push.default in 'git help config'.
原因:远程分支只有master,本地拉取分支时候将本地分支命名为m1;这时候push时候找不到对应的远程分支;
解决办法:
情景一:本地分支名称和远程分支名称一致,这样推送就没有问题;
//将本地当前分支 推送到 与本地当前分支同名的远程分支上
git push
或者
git push origin <本地分支名>
情景二:提交时指定本地分支与远程分支名称
git push origin <本地分支名>:<远程分支名>
本文标签: branchupstreamMATCHCurrent
版权声明:本文标题:The upstream branch of your current branch does not match the name of your current branch 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:https://m.elefans.com/dianzi/1728627807a1166718.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论