Can’t Pull a Git Branch Because of Merge Conflicts?


Sometimes you need to pull a remote branch and want to accept all their commits (and history) and override your own repository.

It’s quite simple if you do a pull, don’t care about unrelated histories and accept all their code when there’s a conflict.

git pull upstream master  --allow-unrelated-histories  -s recursive -X theirs

Then simply push to your own remote and you’re done!