Home » Android » android – unknown option `allow-unrelated-histories'

android – unknown option `allow-unrelated-histories'

Posted by: admin June 15, 2020 Leave a comment


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:

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

My enviroment: Ubuntu LTS 14.04

[email protected]:~/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!

How to&Answers:

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.