Site icon i2tutorials

Git – Unrelated History

Git Unrelated History 

 

            fatal: refusing to merge unrelated histories

Run one of the below commands :

 # It could be master
 git pull origin master --allow-unrelated-histories
 # Or main
 git pull origin main --allow-unrelated-histories
 # Or just try with origin
 git pull origin main --allow-unrelated-histories

If it opens the nano editor you can just save and close with Ctrl + X.

Now push the changes on local

 git push origin master

 

Exit mobile version