我想知道是否可以编写我自己的自定义 merge 并使用它来代替标准 merge 。
想到的唯一想法是将它作为 merge.tool 放入配置中,但这将使它在标准 git-merge 之后运行,而不是代替它。
谢谢!
最佳答案
阅读 gitattributes documentation :
Defining a custom merge driver
The definition of a merge driver is done in the .git/config file, not in the gitattributes file, so strictly speaking this manual page is a wrong place to talk about it. However…
To define a custom merge driver filfre, add a section to your $GIT_DIR/config file (or $HOME/.gitconfig file) like this:
[merge "filfre"]
name = feel-free merge driver
driver = filfre %O %A %B
recursive = binary
关于git - 是否可以替换 git merge 算法?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12977363/