git diff和git difftool有什么区别? [英] What is the difference between `git diff` and `git difftool`?
问题描述
git diff
和git difftool
有什么区别?
我看到我可以编辑git的配置文件,以轻松更改调用git difftool
时使用的外部工具,并且git diff
似乎将修补程序输出到命令行.
I see that I can edit the configuration file for git to easily change the external tool used when I invoke git difftool
and it seems that git diff
outputs patches to the command line.
我为什么要使用git diff
?
推荐答案
正如您和WKPlus所说,git difftool
将使用外部工具,而git diff
将直接在终端中显示差异.
As you and WKPlus said, git difftool
will use an external tool, while git diff
will show the diff directly in the terminal.
要回答关于何时的最后一个问题,您想使用git diff
,您可以考虑以下一些问题:
To answer your last question about when you would want to use git diff
, you can think some of these ones :
- 您没有GUI,因此只能使用终端输出
- 您没有外部工具
- 您不想启动繁重的"外部工具,而只想快速检查两个版本之间的差异
可以想象很多其他示例,也许您会每天使用git自己找到其中一些.
Many other example can be imagined, and maybe you will find some of them yourself using git on daily basis.
这篇关于git diff和git difftool有什么区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!