先pull,因为两个仓库不同,发现refusing to merge unrelated histories,无法pull
因为他们是两个不同的项目,要把两个不同的项目合并,git需要添加一句代码,在git pull,
这句代码是在git 2.9.2版本发生的,最新的版本需要添加–allow-unrelated-histories
git pull origin master --allow-unrelated-histories
特此记录!
本文介绍如何使用Git解决两个不相关项目的历史记录合并问题。当尝试将两个从未互相交互过的项目进行合并时,可能会遇到“refusing to merge unrelated histories”的错误。通过添加`--allow-unrelated-histories`参数到`git pull`命令中可以解决这一问题。
先pull,因为两个仓库不同,发现refusing to merge unrelated histories,无法pull
因为他们是两个不同的项目,要把两个不同的项目合并,git需要添加一句代码,在git pull,
这句代码是在git 2.9.2版本发生的,最新的版本需要添加–allow-unrelated-histories
git pull origin master --allow-unrelated-histories
特此记录!

被折叠的 条评论
为什么被折叠?