Advertisement

Monday, November 11, 2019

DevOps: GIT : fatal: refusing to merge unrelated histories

Let's say you are trying to merge 2 branches using
git pull <remote> <branch>

or example 


$ git pull --allow-unrelated-histories  git@github.com:username/firstrepo.git master

And then you get an error 
.
.
fatal: refusing to merge unrelated histories


At this stage what do you do? 

the easy way to circumvent this problem is to allow 


$ git pull --allow-unrelated-histories  git@github.com:username/firstrepo.git master

However, you need to be cautious of the fact that there is going to be unrelated histories to be merged, if you are sure and want to really pull and merge the branches, then follow above. 

No comments:
Write comments