跳转至

Git 拒绝合并无关历史

概要: 允许将本地和远程的历史进行合并

创建时间: 2022.03.29 22:22:26

更新时间: 2023.08.24 22:53:30

错误提示

在执行 git pull 时候报错如下

Bash
fatal: refusing to merge unrelated histories

原因分析

本地git历史与远端不一致,git默认不合并

解决方法

git pull时加入参数如下

Text Only
git pull --allow-unrelated-histories

参考