X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=Documentation%2Fgit-diff.txt;h=f8d0819113c52ac7c6388ec27eb96083a8c86d4a;hb=d973dc01cc904ae046f6b40911aaf340c04cfdc7;hp=723a64872fd4b43612d576781d915a7538189f46;hpb=c444c16589f95ac22d8e3ffe603cd7f0613512ce;p=git.git diff --git a/Documentation/git-diff.txt b/Documentation/git-diff.txt index 723a64872..f8d081911 100644 --- a/Documentation/git-diff.txt +++ b/Documentation/git-diff.txt @@ -8,12 +8,17 @@ git-diff - Show changes between commits, commit and working tree, etc SYNOPSIS -------- -'git diff' [] {0,2} [--] [...] +[verse] +'git diff' [options] [] [--] [...] +'git diff' [options] --cached [] [--] [...] +'git diff' [options] [--] [...] +'git diff' [options] [--no-index] [--] DESCRIPTION ----------- -Show changes between two trees, a tree and the working tree, a -tree and the index file, or the index file and the working tree. +Show changes between the working tree and the index or a tree, changes +between the index and a tree, changes between two trees, or changes +between two files on disk. 'git diff' [--options] [--] [...]:: @@ -23,9 +28,9 @@ tree and the index file, or the index file and the working tree. further add to the index but you still haven't. You can stage these changes by using linkgit:git-add[1]. + -If exactly two paths are given, and at least one is untracked, -compare the two files / directories. This behavior can be -forced by --no-index. +If exactly two paths are given and at least one points outside +the current repository, 'git diff' will compare the two files / +directories. This behavior can be forced by --no-index. 'git diff' [--options] --cached [] [--] [...]:: @@ -33,6 +38,8 @@ forced by --no-index. commit relative to the named . Typically you would want comparison with the latest commit, so if you do not give , it defaults to HEAD. + If HEAD does not exist (e.g. unborned branches) and + is not given, it shows all staged changes. --staged is a synonym of --cached. 'git diff' [--options] [--] [...]:: @@ -64,15 +71,16 @@ forced by --no-index. Just in case if you are doing something exotic, it should be noted that all of the in the above description, except -for the last two forms that use ".." notations, can be any -. +in the last two forms that use ".." notations, can be any +. The third form ('git diff ') can also +be used to compare two objects. For a more complete list of ways to spell , see -"SPECIFYING REVISIONS" section in linkgit:git-rev-parse[1]. +"SPECIFYING REVISIONS" section in linkgit:gitrevisions[7]. However, "diff" is about comparing two _endpoints_, not ranges, and the range notations (".." and "\...") do not mean a range as defined in the -"SPECIFYING RANGES" section in linkgit:git-rev-parse[1]. +"SPECIFYING RANGES" section in linkgit:gitrevisions[7]. OPTIONS ------- @@ -159,16 +167,12 @@ rewrites (very expensive). SEE ALSO -------- -linkgit:git-difftool[1]:: - Show changes using common diff tools - -Author ------- -Written by Linus Torvalds - -Documentation --------------- -Documentation by Junio C Hamano and the git-list . +diff(1), +linkgit:git-difftool[1], +linkgit:git-log[1], +linkgit:gitdiffcore[7], +linkgit:git-format-patch[1], +linkgit:git-apply[1] GIT ---