I\'m learning git, and I\'m following the Git community book.
Previously (long time ago) I made a public repository on Github, with some files. Now I set up a local
When I used --allow-unrelated-histories, this command generated too many conflicts. There were conflicts in files which I didn't even work on. To get over the error " Refusing to merge unrelated histories", I used following rebase command:
git pull --rebase=preserve --allow-unrelated-histories
After this commit the uncommitted changes with a commit message. Finally, run the following command:
git rebase --continue
After this, my working copy was up-to-date with the remote copy and I was able to push my changes as before. No more unrelated histories error while pulling.