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!

Tags:
0 0 vote
Article Rating
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments