Is there any way to write a custom merge conflict resolver in git? We are having evil merge conflicts resulting from changing java import statements on multiple branches. These seem like they would be fairly easy to write a plugin to handle automatically 90% of the time. Does git have hooks that would allow us to write custom auto-merge behavior for just this situation?
You can define a new merge strategy in .gitconfig
as described here.
[merge "mymergescheme"]
name = my awesome merger
driver = "my_executable_here"
You can then specify that merge strategy for particular files inside .gitattributes
as described at the same page.
src/*.java merge=mymergescheme
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With