Daniel Kobe
Daniel Kobe

Reputation: 9825

Quickly resolving GIT merge conflict with --theirs

I have a branch called 'feature_game_rooms'. I would like to merge this branch into master. I basically want master to be an exact copy of feature_game_rooms. Heres what I've tried
1. git checkout master
2. git merge feature_game_rooms ---> results in Automatic merge failed; fix conflicts and then commit the result.
3. git add .
4. git checkout --theirs .
This resulted in a compilation errors though because the conflict markers are still in my files.

Heres what git status looks like after git merge feature_game_rooms:

enter image description here

Upvotes: 4

Views: 9088

Answers (1)

Daniel Kobe
Daniel Kobe

Reputation: 9825

With help from Lol4t0's comment, I looked into merging recursively with the the theirs option. Heres what I did:
1. git checkout master
2. git merge -Xtheirs feature_game_rooms --> still 1 conflict because branch deleted a file that master has
3. git add . <-- removes file
Heres a link that helped me out

Upvotes: 8

Related Questions