Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Git - what does CONFLICT (rename/delete) mean?

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.

like image 608
BenKoshy Avatar asked Sep 03 '16 23:09

BenKoshy


2 Answers

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).

like image 95
Marcelo Ávila de Oliveira Avatar answered Sep 16 '22 15:09

Marcelo Ávila de Oliveira


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/

like image 23
Linkx_lair Avatar answered Sep 20 '22 15:09

Linkx_lair