2016-12-28 159 views
2

我有兩個回購:Market和Android。當我合併的Android產品上市使用以下步驟:未知選項`allow-unrelated-historories'

cd market 
git remote add android ../android 
git fetch android 
git merge --allow-unrelated-histories android/master 

但我得到這個錯誤:

[email protected]:~/market$ git merge --allow-unrelated-histories android/master error: unknown option `allow-unrelated-histories'

我的環境:Ubuntu的LTS 14.04

[email protected]:~/market$ git --version 
git version 1.9.1 

,則該選項從Git的刪除合併,還是我需要一些額外的配置?

任何幫助將不勝感激,謝謝!

+2

[This answer](http://stackoverflow.com/a/37938036/391161)似乎表明這個選項是在2.9中引入的,並且你的git版本應該默認使用這個選項集。 – merlin2011

+0

謝謝。我已經完成了apt-get update和apt-get upgrade。之後我想我的版本是最新的。從你的評論,我必須manuall安裝最新版本的git。我現在就試一試。 –

+1

這兩個命令通常只會讓你獲得最新版本的git,版本庫維護人員已經更新了版本庫,並且你的Ubuntu版本於2014年4月發佈。 – merlin2011

回答

5

我怎麼說選項中Git 2.9, June 2016被引入(如通過merlin2011the comments提及)之前記錄

由於Ubuntu的LTS 14.04配備了一個老1.9+的Git,you need to reference an up-to-date ppa

sudo add-apt-repository ppa:git-core/ppa 
sudo apt-get update 

ppa (Personnal Archive Package)git-core/+archive/ubuntu/ppa,並將包含最新的Git 2.11版本。

+1

@KrisRoofe襪子可能工作。如果沒有:http://danrossiter.org/tunneling-through-the-great-firewall-of-china-again/或http://blog.zorinaq.com/my-experience-with-the-great-firewall-的,中國/ – VonC