git报错:refusing to merge unrelated histories

合并pull两个不同的项目,出现的问题如何去解决fatal: refusing to merge unrelated histories

原因:版本相差太久或他们是两个不同的项目,要把两个不同的项目合并,git需要添加一句代码,在git pull,这句代码是在git 2.9.2版本发生的,最新的版本需要添加--allow-unrelated-histories

假如我们的源是origin,分支是master,那么我们 需要这样写git pull origin master --allow-unrelated-histories

posted @ 2022-07-08 19:43  Mr_胡萝卜须  阅读(50)  评论(0编辑  收藏  举报