I am fairly new to TortoiseGit. Wondering, if I get a conflict on a .resx file, how do I resolve it during a merge? For example, I could select "using theirs" off of the menu, try to do a pull and push, but is this the right approach? Can I somehow use theirs and rebuild it with my project changes? The differences (as well as mixed up contents compared to the respository) are many - to many to do a real merge. Thanks for looking?
问题:
回答1:
This is an old question that has not been answered. However resolving conflicts in resx files is driving me nuts. The main issue seems to be that resx files can be changed randomly when updated. Visual Studio does not care about the order. As a result a lot of trivial 'conflicts' can arise because of elements being in different places in the two resx files.
I found the answer is to sort the resx files by name attribute before the merge. This article explains how it is done and provides a simple command line tool. The author refers to how it can be integrated into different diff/merge tools. His example is Beyond Compare 3 (which I use) and this article gives instructions on how to do the integration.
I tried this and for the first time I managed a merge of branches with GUI changes without loss or hair or hours of manually repairing things in Visual Studio.
I hope this answer is relevant and may help folks as it helped me
回答2:
My solution is a bit hacky but it takes care of the Resources.designer.cs file too.
VS auto generates Resources.designer.cs from Resources.resx so i just fix the later and regenerate Resources.designer.cs
Typically I do the following stages:
close VS
command line : git merge (merges src branch to current)
i see the conflict in Resources.resx
delete Resources.Designer.cs file (it will get regenerated later)
open Resources.resx with some resolve tool (i just use notepad++)
resolve the conflicts manually (in notepad, typically i search for "<<<", remove the "<<<","-----",">>>>" lines add the missing and save.
open VS with the project, it will complain about missing Resources.designer.cs file.
double click Resource.resx, add at the end some fake row + save (this recreates Resources.designer.cs)
del the fake row i created before and save.