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

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.
What does the above mean?
How do I resolve the issue?
Any advice would be much appreciated.

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/

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

Related

Swift Package Manager rename and deletion not visible after merge. No merge conflicts shown

i am creating a private swift package for myself that I use in a different project.
For the package I have a develop, acceptance and master branch.
When I make a change in the project like a rename or a deletion of a file I merge this to the develop branch.
However when I later merge the develop branch to the acceptance branch or the acceptance branch to master branch I do not see this changes.
Instead the deleted files are back and the file I renamed also get back with the original file name.
I expect merge conflicts but those are not shown.
I checked the .gitignore to see if what gets ignored but I do not see anything that has to do with this.
I am not sure what I am doing wrong here or if it's simply not common for packages to work like this. Anyone got the same problem or tips on how to make it work better?

Bulk resolve merge conflicts in tfs

I have my source control data on a separate partition.
When I rebuilt my machine I pointed my work space to the old location.
Then I did a get latest and was confronted by a lot of merge conflicts that couldn't be resolved by auto merge (A non version controlled file or writable file by the same name already exists locally).
While I can resolve each conflict there are a lot of them.
Can I bulk resolve these conflicts?
Firstly, this is a pain don't do this.
Shelve all your change-sets so you can wipe the mapped folders and start again.
To bulk resolve just select all and click the resolution.
It is my opinion that the UI does not make it clear you are resolving all item.

Dealing with merge conflicts from model-first generated code

I am working on an MVC5 application where the Entity Framework data access layer is generated with Entity Developer.
We keep source in Git (Git flow) and I have merge conflict issues every time the model changes in a feature when I try rebasing with our main branch.
For example, I am working on a feature which is many commits ahead of develop - when I try rebasing the first issue looks like this:
Unmerged paths:
(use "git reset HEAD <file>..." to unstage)
(use "git add <file>..." to mark resolution)
both modified: App.Models/App.Base.view
both modified: App.Models/App.PregeneratedViews.cs
both modified: App.Models/App.edml
both modified: App.Models/App.ssdl
Can anyone offer a strategy or advice of how to deal with merge conflict issues arising from using model-first generated code as above?
How can I work with a Git flow process and model-first generated code?
How do others deal with these types of problems?
Should I push for us to ditch model-first and go code-first? (This is the only solution I can see at the moment)
(I realise this might be opinion-based but I believe others will have the same types of problems making the question relevant?)
Well, the solution is simple. Never ever ever ever add generated code to a VCS. Generated code is a build artifact and build artifact have nothing to do in a VCS. They just duplicate the information that is already present in the generation source and thus should not be versioned. This way you will also not have merge conflicts in them, you simply generate the new versions as part of your build.

TFS Check which files have been manually merged

A merge has been completed in a local workspace. I'm interested to see which files were manually merged (ie which ones initially came up in the resolve conflicts window).
Is there any way to find this out now that all conflicts have been resolved?
Shelve the merge and undo local changes. Then merge again and record the list of conflicts that cannot be automatically resolved.
This is the slow and painful answer. I sincerely hope there is a better way so I can delete this and not have to sit through a tonne of progress bars.

pull changes from branch when deleting files

I can't figure out the best way to do this and it has happened a few times where I mess myself up that it'd be nice to know a possible good way for this. On master, I have our main project. We finally got approved to use ARC in iOS and I created a new branch for that to not mess with the main working master branch. I also took the time to delete some unneeded files in my ARCBranch. What I want to do is use this branch for development for the next release. I'd like to pull in the changes from master to the ARCBranch. So I switched to ARCBranch, and did
git pull origin master
I got conflicts, some which were straightforward because I could see the code, others being changes in the pbxproj file where I cannot tell what's what. I did see
<<< HEAD ==== >>>. I can't tell what I need to do here. I can't open it in Xcode, only a text editor. I tried just deleting those <<< === >>> characters since I saw one person on SO say that you typically want both changes and that you could always do that. This didn't work for me. I was wondering if there is a better way to do this change. Maybe somewhere where I can see each change by change happen? Thanks.
Instead, you could try
git rebase master
This would apply the changes commit by commit. If there are conflicts, it would stop there, so that you can resolve them and do
git rebase --continue
to finish applying all the patches.
It failed to auto merge so it marks the conflicting blocks of code and leaves them both so you can decide and remove one yourself.

Resources