问题描述
git pull <origin> <branch>
报错:fatal: refusing to merge unrelated histories
git pull 更新后,git log查看提交记录,非最新代码,且HEAD未指向远程库和分支。
解决方法
1)git pull <origin> <branch> --allow-unrelated-histories
报错:AutoMatic merge failed;fix conflicts and then commit the result.
合并失败:需解决冲突后合并。
冲突较多的情况下不适合。
2)git fetch <origin> <branch>
合并成功