• 欢迎光临~

git pull提示fatal: refusing to merge unrelated histories错误的解决方法

开发技术 开发技术 2022-12-31 次浏览

添加github仓库路径后更新代码,执行git pull origin main报这个错误

* branch            main       -> FETCH_HEAD
fatal: refusing to merge unrelated histories

原因:远程仓库有改动,早于本地添加仓库路径,导致出现拒绝merge不相关的历史记录
解决方法:添加--allow-unrelated-histories

git pull origin main --allow-unrelated-histories
喜欢 (0)