[Solved] Git Error: fatal: refusing to merge unrelated histories

1. Problem

fatal: refusing to merge unrelated histories

2. Scene

Merge other branches into master branch

3. Reason

The two branches are two different versions with different commit histories, so an error is reported.

4. Solutions

Allow unrelated historical commits and force merges, the code is as follows:

git pull origin master --allow-unrelated-histories

Read More:

Leave a Reply

Your email address will not be published. Required fields are marked *