Is it possible to replace the git merge algorithm?

I am wondering if you can write your own custom merge and use it instead of the standard one.

The only idea that comes to mind is to put it in the configuration as merge.tool, but it will make it run AFTER the standard git-merge, and not instead.

Thanks!

+4
source share
1 answer

Read the gitattributes documentation :

Defining a custom merge driver

The definition of the merge driver is done in the .git / config file and not in the gitattributes file, so strictly speaking, this manual page is the wrong place to talk about it. But...

To define a custom merge filfre file, add a section to the $ GIT_DIR / config file (or the $ HOME / .gitconfig file), for example:

[merge "filfre"] name = feel-free merge driver driver = filfre %O %A %B recursive = binary 
+4
source

Source: https://habr.com/ru/post/1440816/


All Articles