1. 程式人生 > >【git】如何去解決fatal: refusing to merge unrelated histories

【git】如何去解決fatal: refusing to merge unrelated histories

allow 版本 ref 新的 新建 -- 本地 -h git pull

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


先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】如何去解決fatal: refusing to merge unrelated histories