将 git diff 设置为默认值

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/4955752/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-19 05:02:28  来源:igfitidea点击:

Set git diff to a default value

gitdiff

提问by axel22

I previously changed my git diff tool with git config --global diff.external <diff-tool-name>. I decided I don't like that tool and wanted to switch back.

我之前用 .git 更改了我的 git diff 工具git config --global diff.external <diff-tool-name>。我决定我不喜欢那个工具并想切换回来。

I tried meddling around and did something like: git config --global diff.external git-diff. Now calling git diffto see unstaged changes yields:

我试图插手各地和不喜欢的东西:git config --global diff.external git-diff。现在调用git diff以查看未暂存的更改产生:

fatal: ambiguous argument '48e66b706d21398f28240810e7fc0d44d8f92d99': unknown revision or path not in the working tr
Use '--' to separate paths from revisions
external diff died, stopping at somefile.ext.

How do I set my git diffcommand to use the default command line git diff that came with git. Something like:

如何设置我的git diff命令以使用 git 附带的默认命令行 git diff。就像是:

git config --global diff.

git config --global diff.

and then what?

然后什么?

回答by eckes

Try
git config --global --unset diff

尝试
git config --global --unset diff

and

git config --global --unset diff.external

git config --global --unset diff.external

See the explanation of git configfor further details.

有关git config更多详细信息,请参阅 的说明。