Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

TortoiseGit / Winforms: Resolving Resource.resx When Merging

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?

like image 956
Buck Avatar asked Jan 10 '23 20:01

Buck


1 Answers

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

like image 104
ScruffyDuck Avatar answered Jan 16 '23 01:01

ScruffyDuck