原因

导致这种错误是因为两个仓库没有关系,所以在合并的时候远端仓库觉得和本地仓库没有关系,就报了refusing to merge unrelated histories

解决方法

加上–allow-unrelated-histories选项,将两个不相干仓库强行合并

1
git pull origin master --allow-unrelated-histories