提交 bd52900d 编写于 作者: J Junio C Hamano

Documentation: Describe "git diff <blob> <blob>" separately

As it was not a common operation, it was described as if it is a
side note for the more common two-commit variant, but this mode
behaves very differently, e.g. it does not make any sense to ask
recursive behaviour, or give the command a pathspec.
Signed-off-by: NJunio C Hamano <gitster@pobox.com>
上级 7e201053
...@@ -12,6 +12,7 @@ SYNOPSIS ...@@ -12,6 +12,7 @@ SYNOPSIS
'git diff' [options] [<commit>] [--] [<path>...] 'git diff' [options] [<commit>] [--] [<path>...]
'git diff' [options] --cached [<commit>] [--] [<path>...] 'git diff' [options] --cached [<commit>] [--] [<path>...]
'git diff' [options] <commit> <commit> [--] [<path>...] 'git diff' [options] <commit> <commit> [--] [<path>...]
'git diff' [options] <blob> <blob>
'git diff' [options] [--no-index] [--] <path> <path> 'git diff' [options] [--no-index] [--] <path> <path>
DESCRIPTION DESCRIPTION
...@@ -55,6 +56,11 @@ directories. This behavior can be forced by --no-index. ...@@ -55,6 +56,11 @@ directories. This behavior can be forced by --no-index.
This is to view the changes between two arbitrary This is to view the changes between two arbitrary
<commit>. <commit>.
'git diff' [options] <blob> <blob>::
This form is to view the differences between the raw
contents of two blob objects.
'git diff' [--options] <commit>..<commit> [--] [<path>...]:: 'git diff' [--options] <commit>..<commit> [--] [<path>...]::
This is synonymous to the previous form. If <commit> on This is synonymous to the previous form. If <commit> on
...@@ -72,8 +78,7 @@ directories. This behavior can be forced by --no-index. ...@@ -72,8 +78,7 @@ directories. This behavior can be forced by --no-index.
Just in case if you are doing something exotic, it should be Just in case if you are doing something exotic, it should be
noted that all of the <commit> in the above description, except noted that all of the <commit> in the above description, except
in the last two forms that use ".." notations, can be any in the last two forms that use ".." notations, can be any
<tree>. The third form ('git diff <commit> <commit>') can also <tree>.
be used to compare two <blob> objects.
For a more complete list of ways to spell <commit>, see For a more complete list of ways to spell <commit>, see
"SPECIFYING REVISIONS" section in linkgit:gitrevisions[7]. "SPECIFYING REVISIONS" section in linkgit:gitrevisions[7].
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册