WestCoastProjects
WestCoastProjects

Reputation: 63201

How to force merge using "theirs" strategy when told there are unmerged files

When running git merge with theirs:

$git merge --strategy-option theirs

It is not helping to merge the files:

error: Merging 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.

So can that command help me here? Do I need to merge all of the (many..) files manually?

I did look at Git merge strategy 'theirs' is not resolving modify/delete conflict and afaict none of the answers provided a way to do this.

Update I bit the bullet and ran the bfg tool on my active directory since I could not get the merging/resolving to work in a clone. This seems to be moving ahead: here is the IJ enter image description here

Upvotes: 0

Views: 526

Answers (1)

torek
torek

Reputation: 489343

This error message:

error: Merging is not possible because you have unmerged files

means you have already started a merge. You cannot start another merge until you finish, or terminate, the current one. That's all there really is to it. Think back to when you started some earlier merge, that you have not yet finished. Is that merge important? Should you finish it now? If so, finish it now before you start another.

Your other option is to use:

git merge --abort

to tell Git: "Oh, hey, remember that other merge I started yesterday / last week / last year / whenever it was? The one I haven't finished yet? Stop it and get it out of the way now and go back to the way everything was last week or last year or whenever it was."

Caution: stopping and going back to the way things were last year could lose any unsaved changes.

Upvotes: 1

Related Questions