Main Tutorials

Git pull – refusing to merge unrelated histories

Add --allow-unrelated-histories to solve the Git fatal error – “refusing to merge unrelated histories”

Terminal

$ git pull origin master

From https://github.com/mkyong/java-concurrency
 * branch            master     -> FETCH_HEAD
 
fatal: refusing to merge unrelated histories

To fix it :

Terminal

$ git pull origin master --allow-unrelated-histories

From https://github.com/mkyong/java-concurrency
 * branch            master     -> FETCH_HEAD
Merge made by the 'recursive' strategy.
 LICENSE | 674 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 674 insertions(+)
 create mode 100644 LICENSE

References

  1. git-merge documentation –allow-unrelated-histories

About Author

author image
Founder of Mkyong.com, love Java and open source stuff. Follow him on Twitter. If you like my tutorials, consider make a donation to these charities.

Comments

Subscribe
Notify of
6 Comments
Most Voted
Newest Oldest
Inline Feedbacks
View all comments
Sam Hobbs
5 years ago

But what does the error mean? I assume there might be times when we do not want to allow unrelated histories and that is why it is issuing the message.

Akshaya
5 years ago

Thanks!

Anshul Katta
3 years ago

this worked …awesome..i am your big fan

diens madang
4 years ago

thank’s a lot

dubludeNA
4 years ago

Thank you,worked as a charm.

vishwa
4 years ago

thank you!