在git textconv中使用内部存储库路径

时间:2015-02-27 01:37:46

标签: git path attributes config

我想在git中配置textconv,用于人类可读的xml差异。我想将转换器程序保存在git存储库中。但$ {GIT_WORK_TREE}似乎无法运作:

.gitattributes

*.xts -text diff=XtsDiff

的.git \设置

[diff "XtsDiff"]
    textconv = ${GIT_WORK_TREE}/xmllint-1.0.exe
    cachetextconv = true

如何使textconv使用存储库中的路径?

1 个答案:

答案 0 :(得分:0)

这个语法在Windows上适用于 ConEmu cmd.exe git-bash (我假设Linux):

[diff "XtsDiff"]
    textconv = `git rev-parse --show-toplevel`/xmllint-1.0.exe
    cachetextconv = true
相关问题