前言

在开发初期,或者拉取新的项目的时候经常会出现这类问题。出现这种问题的原因是
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
 
posted on 2022-05-24 09:36  topass123  阅读(1874)  评论(0编辑  收藏  举报