在开发初期,或者拉取新的项目的时候经常会出现这类问题。出现这种问题的原因是
1.本地创建的分支,在远程仓库并没有创建
2.解决方案肯定是将本地分支关联到远程
git pull origin master --allow-unrelated-histories
git branch --set-upstream-to=origin/master master
3.如果远程的origin/master和本地的master,名字是不一致的话。
可以考虑使用将本地的分支命名和远程的一致,从而解决
【fatal: The upstream branch of your current branch does not match the name of your current branch】问题
git branch -m master【这里的master是远程存在,本地没有】
git pull
git push
本文来自博客园,作者:topass123,转载请注明原文链接:https://www.cnblogs.com/topass123/p/16304353.html
浙公网安备 33010602011771号