GIT Fatal: Refusing to merge unrelated stories

I see:

$ git pull origin master From https://bitbucket.org/tecgenome/chl-v2.0-html * branch master -> FETCH_HEAD fatal: refusing to merge unrelated histories 

How can I avoid or get past this error message?

+5
source share
2 answers

Since Git 2.9 (April 2016) , you can try:

 git pull --allow-unrelated-histories origin master 

But check out why these branches are no longer common. Maybe there was a force rewriting the whole history of origin/master .

In this case, if you do not have local commits, it is better to reset your branch to a new one:

 git fetch git reset --hard origin/master 
+13
source

I met the same problem and tried the team in which it works.

git merge abbranch --allow-unrelated-history

+1
source

Source: https://habr.com/ru/post/1258194/


All Articles