问题1、fatal: refusing to merge unrelated histories
一、Git 的报错
fatal: refusing to merge unrelated histories
新建了一个仓库之后,把本地仓库进行关联提交、拉取的时候,出现了如下错误:
fatal: 'master' does not appear to be a git repository
fatal: Could not read from remote repository.
二、解决方案
在你操作命令后面加 --allow-unrelated-histories
git merge master --allow-unrelated-histories
$ git pull --allow-unrelated-histories
CONFLICT (add/add): Merge conflict in .gitignore
Auto-merging .gitignore
Automatic merge failed; fix conflicts and then commit the result.
这里由于我中间更换了代码仓库,然后又换回到原来的代码仓库,需要手动合并之后再进行 add、commit 即可。