unknown option `allow-unrelated-histories'

匿名 (未验证) 提交于 2019-12-03 01:26:01

问题:

I have two repos: Market and Android. When I merge Android to Market use these steps:

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

But I get this error:

ei@localhost:~/market$ git merge --allow-unrelated-histories android/master error: unknown option `allow-unrelated-histories'

My enviroment: Ubuntu LTS 14.04

ei@localhost:~/market$ git --version git version 1.9.1 

Is this option removed from Git merge, or do I need some extra config?

Any help would be appreciated, thanks!

回答1:

I documented before how that option has been introduced in Git 2.9, June 2016 (as mentioned by merlin2011 in the comments)

Since Ubuntu LTS 14.04 comes with an old 1.9+ Git, you need to reference an up-to-date ppa:

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

That ppa (Personnal Archive Package) is the git-core/+archive/ubuntu/ppa, and will include the latest Git 2.11 release.



标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!