Git 支持哪些 diff 格式?
Which diff formats are supported by Git?
在 .gitattributes
中,我看到如下内容:
*.htm text diff=html
*.html text diff=html
*.java text diff=java
... diff=astextplain
那些叫法是什么,diff 格式,diff 输出?
哪里是所有支持的差异格式的列表?
Git只是泛指这些"attributes",在the gitattributes
documentation中描述。 diff=
设置是 "diff attribute",无论出于何种原因,built-in 属性列表位于标题为 定义自定义 hunk-header[=26] 的部分中=]:
First, in .gitattributes, you would assign the diff attribute for
paths.
*.tex diff=tex
(这是 Git 标记为 "diff attribute" 的地方)。
There are a few built-in patterns to make this easier, and tex
is one of them, so you do not have to write the above in your configuration file (you still need to enable this with the attribute mechanism, via .gitattributes
). The following built in patterns are available: ...
(我不会在这里重现整个列表,它相当长。请注意,不同版本的 Git 具有不同的 built-in 模式,因此您应该查看您的特定文档Git 的版本,您应该可以使用 git help gitattributes
查看它。)
在 .gitattributes
中,我看到如下内容:
*.htm text diff=html
*.html text diff=html
*.java text diff=java
... diff=astextplain
那些叫法是什么,diff 格式,diff 输出?
哪里是所有支持的差异格式的列表?
Git只是泛指这些"attributes",在the gitattributes
documentation中描述。 diff=
设置是 "diff attribute",无论出于何种原因,built-in 属性列表位于标题为 定义自定义 hunk-header[=26] 的部分中=]:
First, in .gitattributes, you would assign the diff attribute for paths.
*.tex diff=tex
(这是 Git 标记为 "diff attribute" 的地方)。
There are a few built-in patterns to make this easier, and
tex
is one of them, so you do not have to write the above in your configuration file (you still need to enable this with the attribute mechanism, via.gitattributes
). The following built in patterns are available: ...
(我不会在这里重现整个列表,它相当长。请注意,不同版本的 Git 具有不同的 built-in 模式,因此您应该查看您的特定文档Git 的版本,您应该可以使用 git help gitattributes
查看它。)