2016-12-28 155 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