Skip to main content

The reason of fatal refusing to merge unrelated histories

AndyBinOriginalLess than 1 minute

Caption

Warning

Sometimes an error occurs when pulling or merging: fatal: refusing to merge unrelated histories.

Solution:

git merge origin/master --allow-unrelated-histories

The result is as follows:

$ git merge origin/master --allow-unrelated-histories
Already up to date!
Merge made by the 'recursive' strategy.

Just add --allow-unrelated-histories at the end of the command, which tells Git to allow unrelated histories to merge.

Last update:
Contributors: rumosky
Comments
  • Latest
  • Oldest
  • Hottest