问题描述
在我的一个项目中,我有一些带有特定扩展名的文件,我想使用自己的特定工具而不是git本身来合并。
我知道可以通过以下方式在.gitconfig
中指定自定义合并和差异工具:
[difftool "sourcetree"]
cmd = 'C:/somepath/difftool.exe' \"$LOCAL\" \"$REMOTE\"
[mergetool "sourcetree"]
cmd = 'C:/somepath/difftool.exe' \"$BASE\" \"$LOCAL\" \"$REMOTE\" -o \"$MERGED\"
该mergetool将被自动调用以解决冲突。 但是(除非我错过了一些事情),git首先会尝试合并文件本身。出问题的是,git会尝试将这些文件合并为常规文本文件(例如,代码),并且可能会错过存在冲突的事实,或者认为存在冲突而没有冲突。
$ git merge foo
Auto-merging somefile //custom mergetool not called :(
CONFLICT (content): Merge conflict in index.html
Automatic merge Failed; fix conflicts and then commit the result.
我希望在必须合并文件后总是调用我的合并工具(无需git尝试自行进行自动合并)。这可能吗?
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)