Git - Resolve Conflicts/Merge

Best practices, code snippets for common functionality, examples, and guidelines.
armstronghm24
Posts: 42
Joined: Tue Dec 20, 2016 10:16 pm

Git - Resolve Conflicts/Merge

Post by armstronghm24 » Tue Nov 28, 2017 4:08 pm

Has anyone had recent success resolving conflicts and merging changes using Git? I haven't been able to figure out a consistently successful workflow for this. If anyone has a process down, please share.

krstcs
Posts: 2683
Joined: Tue Feb 07, 2012 4:14 pm
Location: Austin, Texas, USA

Re: Git - Resolve Conflicts/Merge

Post by krstcs » Wed Nov 29, 2017 2:37 pm

It's a manual process, that's all. Just open the conflicting files with a text editor (highly recommend Notepad++) and search for the merge conflict sections. There's no magic bullet or quick fix. Ranorex uses XML, which is notoriously difficult to merge correctly (in any CVS) and since Ranorex auto-updates the XML from the UI, it's almost impossible to keep things in perfect sync.

One thing I would recommend is to not have more than one person working on a project at a time. A single project in the solution can be changed and pushed without too much impact to other projects usually.

Also, I have one project that is my "local" library of modules and I name it "<TestSolutionName>_CORE". This is where all of the modules are kept, and the repo is located here as well. All other solutions will use these modules and this allows for the other true test projects to be cleaner, basically only containing the test suite itself. You would still have to worry about merging modules, but if you keep your modules really small it is much easier to deal with. And by "really small" I mean, make each module do only one thing. Click a button, enter a password, etc. Don't have a login module, use the module groups for that. The modules would be "Enter_Username", "Enter_Password", "Click_LoginButton" and the "Enter_..." modules would each take variables "Username" and "Password", respectively. This allows much more flexibility and keeps the whole thing cleaner and clearer.
Shortcuts usually aren't...