X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=Documentation%2Fgit-diff.txt;h=bbab35fcaff35ccd5459251550924a42ce2c871e;hb=7c11144ce4cfdc38ff2b9b13f0eba3c1004cd1a1;hp=f8c06013f3588a96e66d08265afe8131f054b7ff;hpb=ee5a57bc5c5641c30bc626892ddc31ddd18ed7ad;p=platform%2Fupstream%2Fgit.git diff --git a/Documentation/git-diff.txt b/Documentation/git-diff.txt index f8c0601..bbab35f 100644 --- a/Documentation/git-diff.txt +++ b/Documentation/git-diff.txt @@ -18,20 +18,25 @@ SYNOPSIS DESCRIPTION ----------- 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. +between the index and a tree, changes between two trees, changes between +two blob objects, or changes between two files on disk. 'git diff' [--options] [--] [...]:: This form is to view the changes you made relative to the index (staging area for the next commit). In other - words, the differences are what you _could_ tell git to + words, the differences are what you _could_ tell Git to 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 points outside -the current repository, 'git diff' will compare the two files / -directories. This behavior can be forced by --no-index. + +'git diff' --no-index [--options] [--] [...]:: + + This form is to compare the given two paths on the + filesystem. You can omit the `--no-index` option when + running the command in a working tree controlled by Git and + at least one of the paths points outside the working tree, + or when running the command outside a working tree + controlled by Git. 'git diff' [--options] --cached [] [--] [...]:: @@ -39,7 +44,7 @@ directories. This behavior can be 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 + If HEAD does not exist (e.g. unborn branches) and is not given, it shows all staged changes. --staged is a synonym of --cached. @@ -56,11 +61,6 @@ directories. This behavior can be forced by --no-index. This is to view the changes between two arbitrary . -'git diff' [options] :: - - This form is to view the differences between the raw - contents of two blob objects. - 'git diff' [--options] .. [--] [...]:: This is synonymous to the previous form. If on @@ -87,6 +87,11 @@ and the range notations (".." and "\...") do not mean a range as defined in the "SPECIFYING RANGES" section in linkgit:gitrevisions[7]. +'git diff' [options] :: + + This form is to view the differences between the raw + contents of two blob objects. + OPTIONS ------- :git-diff: 1 @@ -153,8 +158,8 @@ $ git diff --name-status <2> $ git diff arch/i386 include/asm-i386 <3> ------------ + -<1> Show only modification, rename and copy, but not addition -nor deletion. +<1> Show only modification, rename, and copy, but not addition +or deletion. <2> Show only names and the nature of change, but not actual diff output. <3> Limit diff output to named subtrees.