gitdifftool运行gitdiff
我显然忽略了一些非常简单的事情,但我没有看到。命令gitdifftool运行gitdiff,git,difftool,Git,Difftool,我显然忽略了一些非常简单的事情,但我没有看到。命令 webstorm diff ~/test.txt ~/test2.txt git difftool ~/test.txt ~/test2.txt 运行JetBrains图形差异工具。我正在运行Git1.8.3.2,并且有一个git.config,其中包括 [diff] tool = webstorm [difftool "webstorm"] cmd = webstorm diff $(cd $(dirname "$LOCA
webstorm diff ~/test.txt ~/test2.txt
git difftool ~/test.txt ~/test2.txt
运行JetBrains图形差异工具。我正在运行Git1.8.3.2,并且有一个git.config,其中包括
[diff]
tool = webstorm
[difftool "webstorm"]
cmd = webstorm diff $(cd $(dirname "$LOCAL") && pwd)/$(basename "$LOCAL") $(cd $(dirname "$REMOTE") && pwd)/$(basename "$REMOTE")
[difftool]
prompt = false
当我运行命令时
webstorm diff ~/test.txt ~/test2.txt
git difftool ~/test.txt ~/test2.txt
我在终端窗口中获得以下信息:
diff --git a/home/mark/test.txt b/home/mark/test2.txt
index 7379ce2..6ce16f1 100644
--- a/home/mark/test.txt
+++ b/home/mark/test2.txt
@@ -1,2 +1,2 @@
-blah
+bluergh
我做错了什么/没有做什么?我也有同样的问题。我的
git diftool
配置已经在我的~/.gitconfig
中设置好了,并且一直工作得很好,但是今天奇怪的是git difftool
在一个repo中工作,但在另一个repo中运行了git diff
修复:我从Git2.11.0更新到Git2.11.1,问题似乎已经解决了
提到修复difftool相关的回归。所描述的问题不是我所看到的,但可能修复程序已经修复了它。运行:
GIT_TRACE=1 git difftool --tool-help
打印可与--tool
一起使用但不可用的差异工具列表
其次,我相信下面的简化示例可能会更好:
[difftool "webstorm"]
cmd = webstorm diff "$LOCAL" "$REMOTE"
或者通过指定二进制文件或脚本的路径,例如
[difftool]
prompt = NO
external = /usr/local/bin/diffmerge
通过以下方式检查差异配置:
git config --get-regex diff
或者更具体地说(用您的工具名称替换webstorm
):
如果仍然不起作用,请在新存储库中测试它,例如,通过以下命令:
mkdir ~/git_test && cd ~/git_test
git init && touch file && git add file && git commit -m'Adds file' -a
echo changed >> file
GIT_TRACE=1 git difftool
如果上述方法有效,那么请确保您的存储库配置没有任何意外情况,例如
more "$(git rev-parse --show-toplevel)"/.git/config
如果您处于合并状态(通过
git status
检查),则需要使用mergetool
,例如
git mergetool
添加-t工具
以指定哪个工具。通过git mergetool--tool help提供的列表
另请参见
mangitdifftool
:
CONFIG VARIABLES
git difftool falls back to git mergetool config variables when the difftool equivalents have not been
defined.
diff.tool
The default diff tool to use.
diff.guitool
The default diff tool to use when --gui is specified.
difftool.<tool>.path
Override the path for the given tool. This is useful in case your tool is not in the PATH.
difftool.<tool>.cmd
Specify the command to invoke the specified diff tool.
See the --tool=<tool> option above for more details.
difftool.prompt
Prompt before each invocation of the diff tool.
CONFIG变量
当difftool等价物还没有被修改时,git difftool会返回到git mergetool配置变量
定义
差动工具
要使用的默认差异工具。
差动吉他
指定--gui时使用的默认差异工具。
difftool..路径
替代给定工具的路径。如果工具不在路径中,这非常有用。
difftool..cmd
指定用于调用指定的diff工具的命令。
有关更多详细信息,请参见上面的--tool=选项。
difftool.prompt
在每次调用diff工具之前提示。
也许您需要将绝对路径传递给webstorm
?webstorm文件夹位于路径中。我知道它已经在您的路径中,但您是否尝试过使用绝对路径来代替它?我现在已经这样做了,并且我向[difftool“webstorm”]部分添加了一个路径。我还重新命名了该部分,以防我遇到相同的问题-仍然没有任何东西(除了直接从命令行运行它)处理相同的问题。。我的配置文件设置为使用meld,它位于我的路径中。当我运行:git difftool时,git运行“diff”。我在我的配置中添加了一个部分,如下所示(用于指定meld的完整路径,但没有帮助)。此配置代码段与我的全局配置文件($HOME/.gitconfig)以及我的项目特定配置文件中的配置代码段相同。>>[difftool“meld”]>>>>path=/usr/bin/meld>>>[diff]>>>tool=meld