fatal: refusing to merge unrelated histories.

0 votes

Hi Guys,

While trying to combine an existing repository, with a remote repository using git pull command, It shows me the below error.

git pull origin master
From https://github.com/nadim70
* branch            master     -> FETCH_HEAD
fatal: refusing to merge unrelated histories
 command, it shows me the below error.

How to solve this error?

Thank You

Apr 10 in Git & GitHub by akhtar
• 10,330 points
356 views

1 answer to this question.

0 votes

Hi@akhtar,

It means your work tree and the remote tree you just added do not have any commit in common. That means Git cannot know what to do with them.

So start examining the log of both repositories using bellow command.

vimdiff =(git log master) =(git log remotes/origin/master)

If it is confirmed that the trees do not have commit in common, then check each commit one by one and try to match each commit in both the location.

answered Apr 10 by MD
• 22,520 points

Related Questions In Git & GitHub

0 votes
1 answer

How to do a re-merge into another branch in git

Seems like you want to rebase your ...READ MORE

answered May 7, 2018 in Git & GitHub by DareDev
• 6,850 points
422 views
0 votes
1 answer

gerrit-cherry-pick:fatal: 'origin' does not appear to be a git repository

The user account making that command does ...READ MORE

answered Aug 13, 2018 in Git & GitHub by Kalgi
• 51,850 points
380 views
0 votes
1 answer

I am not able to use pull, push, branch merge

Please execute the below command in the ...READ MORE

answered May 23, 2019 in Git & GitHub by Umer
79 views
0 votes
0 answers

Difference between git rebase and git merge? Which among them is better to use?

Difference between git rebase and git merge? ...READ MORE

Nov 25, 2019 in Git & GitHub by anonymous
• 10,080 points

closed Nov 25, 2019 by Sirajul 133 views
+13 votes
2 answers

Git management technique when there are multiple customers and need multiple customization?

Consider this - In 'extended' Git-Flow, (Git-Multi-Flow, ...READ MORE

answered Mar 26, 2018 in DevOps & Agile by DragonLord999
• 8,400 points
492 views
0 votes
1 answer
0 votes
1 answer

fatal: unable to access could not resolve host: GitHub

Hi@akhtar, This can be caused in incorrect proxy ...READ MORE

answered Apr 10 in Git & GitHub by MD
• 22,520 points
509 views
0 votes
1 answer

How to merge data between Git branches?

Hi@akhtar, You can merge your data between Git ...READ MORE

answered May 10 in Git & GitHub by MD
• 22,520 points
30 views