1. 程式人生 > >git無法pull倉庫refusing to merge unrelated histories

git無法pull倉庫refusing to merge unrelated histories

org alt bsp 共享 dex 疑問 his 發生 using

http://blog.csdn.net/lindexi_gd/article/details/52554159

本文講的是把Git在最新2.9.2,合並pull兩個不同的項目,出現的問題如何去解決fatal: refusing to merge unrelated histories

我在Github新建一個倉庫,寫了License,然後把本地一個寫了很久倉庫上傳。

先pull,因為兩個倉庫不同,發現refusing to merge unrelated histories,無法pull

因為他們是兩個不同的項目,要把兩個不同的項目合並,git需要添加一句代碼,在git pull,這句代碼是在git 2.9.2版本發生的,最新的版本需要添加--allow-unrelated-histories

假如我們的源是origin,分支是master,那麽我們 需要這樣寫git pull origin master --allow-unrelated-histories需要知道,我們的源可以是本地的路徑

技術分享
本作品采用知識共享署名-非商業性使用-相同方式共享 4.0 國際許可協議進行許可。歡迎轉載、使用、重新發布,但務必保留文章署名林德熙(包含鏈接:http://blog.csdn.net/lindexi_gd ),不得用於商業目的,基於本文修改後的作品務必以相同的許可發布。如有任何疑問,請與我聯系。

git無法pull倉庫refusing to merge unrelated histories