背景
在本地新建一个项目后,想要同步到github上,习惯性的会去点一个 add readme ,导致远程仓库中和本地仓库版本信息不一致的问题,具体的是再pull的过程中遇到这个问题 
问题复现
先在本地随便编写一些代码 
再github上新建仓库 获取shh连接
git@github.com:Leezed525/******-uniapp.git //去获取自己的仓库地址
添加远程仓库
git remote add origin git@github.com:Leezed525/******-uniapp.git
在push的时候就会发现push不成功 
进行pull就会发生这个错误
$ git pull origin/master
fatal: 'origin/master' does not appear to be a git repository
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
解决办法
运行这个命令
git pull origin master --allow-unrelated-histories
就能强制把文件pull下来,然后再push就ok啦
|