我的情况是story是这样的,
我在gitlab上有两个repository,一个是用户开发的,另一个是由于发布的,在开发的一段时间后,需要把发放的内容merge到用于发布的repository上,这是两个独立的repository,直接没有联系,当我执行下面的语句是,出现了 fatal: refusing to merge unrelated histories这样的信息
>>>>>>
+ git merge --no-ff --no-commit upstream/branchA
fatal: refusing to merge unrelated histories
我的解决方法是在上面的命令上添加了(--allow-unrelated-histories)
git merge --no-ff --no-commit --allow-unrelated-histories upstream/branchA
就解决了
还有另外一种方法是在pull的时候加上边的参数
git pull origin master --allow-unrelated-histories