【问题标题】:mergetool from .gitconfig being ignored?.gitconfig 中的mergetool 被忽略了吗?
【发布时间】:2011-09-15 17:26:12
【问题描述】:

git config --global mergetool.bc3 "\"c:/program files (x86)/beyond compare 3/bcomp.exe\" \"$LOCAL\" \"$REMOTE\" \"$BASE\" \"$MERGED\""

git mergetool

/usr/lib/git-core/git-mergetool--lib: line 116: bcompare: command not found

这非常奇怪,因为./.git/config~/.gitconfig 看起来都是正确的。两者都没有列出bcompare 的条目。 git 可以从.git/config~/.gitconfig 以外的任何地方读取或存储配置吗?

【问题讨论】:

    标签: git beyondcompare git-config


    【解决方案1】:

    看起来与this guy 遇到的问题相同。看起来 bc3 是一个内置工具名称,而 git 不允许覆盖该名称。尝试使用 bc3 以外的名称。

    我使用了“BeyondCompare3”

    [mergetool "BeyondCompare3"]
        path = C:/Program Files/Beyond Compare 3/bcomp.exe
        cmd = \"C:/Program Files/Beyond Compare 3/bcomp.exe\" \"$LOCAL\" \"$REMOTE\" \"$BASE\" \"$MERGED\"
    

    【讨论】:

    • 这正是发生了什么。
    【解决方案2】:

    如果您需要覆盖合并工具的路径,您只需设置变量mergetool.<tool>.path

    可以使用mergetool.<tool>.cmd 指定自定义合并工具(Beyond Compare 3 不需要),但mergetool.<tool> 形式的变量对git mergetool 没有任何意义。如果您被指示从文档中尝试此操作,也许您可​​以说明可以解决此问题的位置。

    【讨论】:

    • 如果你的cygwin用完了,这是必要的。
    猜你喜欢
    • 2012-05-09
    • 2020-07-07
    • 2020-04-18
    • 1970-01-01
    • 1970-01-01
    • 2011-12-18
    • 2019-03-07
    • 2020-06-18
    • 2012-02-17
    相关资源
    最近更新 更多