13

I did not find much success in understanding what this means in other SO questions.

this is for a ruby on rails project. it's probably really straightforward if you know what to do. I tried merging two branches and this was (part) of the result.

CONFLICT (rename/delete): db/migrate/20160705073411_create_building_employees.rb deleted in HEAD and renamed in user-authentication. Version user-authentication of db/migrate/20160705073411_create_building_employees.rb left in tree.
Removing app/models/buildings_user.rb
Automatic merge failed; fix conflicts and then commit the result.
  • There were a tonne of files which were marked as "modified"
  • there was one 'unmerged' path. Namely:

added by them: db/migrate/20160705073411_create_building_employees.rb

when I opened up the file i saw nothing to really resolve. there were no asterix running across the page.

  1. What does the above mean?
  2. How do I resolve the issue?

Any advice would be much appreciated.

BenKoshy
  • 33,477
  • 14
  • 111
  • 80
  • The simplest principle to solve conflicts is to keep and add what you want and remove what you don't. – ElpieKay Sep 03 '16 at 23:38
  • Possible duplicate of [git - merge conflict when local is deleted but file exists in remote](https://stackoverflow.com/questions/4319486/git-merge-conflict-when-local-is-deleted-but-file-exists-in-remote) – IMSoP Jul 19 '19 at 09:31

2 Answers2

10

The error "Conflict (rename/delete)" means that a file was renamed in one branch and deleted in another(create_building_employees.rb deleted in HEAD). This type of conflict is not with the content of the files themselves- but with the directory/tree of the branches. You should use Git Mergetools to do a diff between the branches and then make whatever modifications needed

Here is a great thread on resolving conflicts How to resolve merge conflicts in Git? And see the blogpost: http://weblog.masukomi.org/2008/07/12/handling-and-avoiding-conflicts-in-git/

Community
  • 1
  • 1
Linkx_lair
  • 569
  • 1
  • 9
  • 21
4

This conflict message means that some files were deleted in one branch and renamed in the other. You need to decide for each one if you want to remove the file or to keep it (with the new name).