tags:

views:

498

answers:

2

Hi,

I have create a 'dialog' branch and when I try to merge it to 'master' branch. There are 2 conflicts. I don't know how to resolve 'CONFLICT (delete/modify)'. Can you please tell me what to do?

$ git checkout master
$ git merge dialog
CONFLICT (delete/modify): res/layout/dialog_item.xml deleted in dialog and modified in HEAD. Version HEAD of res/layout/dialog_item.xml left in tree.
Auto-merging src/com/DialogAdapter.java
CONFLICT (content): Merge conflict in src/DialogAdapter.java
Automatic merge failed; fix conflicts and then commit the result.

I have opened src/DialogAdapter.java and fix the conflict and do a 'git add src/DialogAdapter.java'. What else do i need to do?

+1  A: 

You can read this post on Stack Overflow:

The accepted answer references the git manual.

heavyd
My case is to do with removing a file in git. I know how to merge a conflict in content. i don't know how to resolve it in this case "CONFLICT (delete/modify)"
n179911
It said 'CONFLICT (delete/modify): res/layout/dialog_item.xml deleted in dialog and modified in HEAD. Version HEAD of res/layout/dialog_item.xml left in tree.' What can i do to take the 'deletion' in dialog and forget about the modification in 'master'?
n179911
+2  A: 

The conflict message:

CONFLICT (delete/modify): res/layout/dialog_item.xml deleted in dialog and modified in HEAD

means that res/layout/dialog_item.xml was deleted in the 'dialog' branch you are merging, but was modified in HEAD (in the branch you are merging to).

So you have to decide whether

  • remove file using "git rm res/layout/dialog_item.xml"

or

  • accept version from HEAD (perhaps after editing it) with "git add res/layout/dialog_item.xml"

Then you finalize merge with "git commit".

Jakub Narębski
Thank you. Jakub.
n179911