Tuesday, November 29, 2016

Fix conflicts for git pull using theirs

Command:

git pull

Output:
error: Pull is not possible because you have unmerged files.
hint: Fix them up in the work tree, and then use 'git add/rm <file>'
hint: as appropriate to mark resolution and make a commit.
fatal: Exiting because of an unresolved conflict.

Solution:
git reset --mixed -> this unstage all files that are in conflict
git add -> all the files that you have fixed fo the conflict
git commit
git reset --hard
git merge --strategy=recursive -X theirs origin/master

No comments:

Post a Comment