0 votes
1 view
in DevOps and Agile by (20k points)

How do I resolve a git merge conflict in favor of pulled changes?

Basically, I need to remove all conflicting changes from a working tree without having to go through all of the conflicts with a git mergetool while keeping all conflict-free changes. Preferably doing this while pulling, not afterward.

1 Answer

0 votes
by (28.4k points)

Case 1: In case you are in a conflicted state and you want to just accept all of theirs:

$ git checkout --theirs .

$ git add .

Case 2: In case you want to do the opposite:

$ git checkout --ours .

$ git add .

Remember this method is pretty drastic, so make sure you really want to wipe everything out like this before doing it.

Welcome to Intellipaat Community. Get your technical queries answered by top developers !


Categories

...