Member-only story
The “fatal: refusing to merge unrelated histories” Git error
1 min readFeb 11, 2020
The “fatal: refusing to merge unrelated histories” Git error occurs when two unrelated projects are merged (i.e., projects that are not aware of each other’s existence and have mismatching commit histories).
Solution
The error is resolved by toggling the allow-unrelated-histories switch. After a git pull
or git merge
command, add the following tag:
git pull origin master --allow-unrelated-histories
More information can be found here, on Git’s official documentation.