further add to the index but you still haven't. You can\r
stage these changes by using <a href="git-add.html">git-add(1)</a>.\r
</p>\r
-<div class="literalblock">\r
-<div class="content">\r
-<pre><tt>If exactly two paths are given, and at least one is untracked,\r
+<p>If exactly two paths are given, and at least one is untracked,\r
compare the two files / directories. This behavior can be\r
-forced by --no-index.</tt></pre>\r
-</div></div>\r
+forced by --no-index.</p>\r
</dd>\r
<dt>\r
<em>git-diff</em> [--options] --cached [<commit>] [--] [<path>…]\r
</dt>\r
<dd>\r
<p>\r
- This form is to view the changes between two <commit>,\r
- for example, tips of two branches.\r
+ This is to view the changes between two arbitrary\r
+ <commit>.\r
+</p>\r
+</dd>\r
+<dt>\r
+<em>git-diff</em> [--options] <commit>..<commit> [--] [<path>…]\r
+</dt>\r
+<dd>\r
+<p>\r
+ This is synonymous to the previous form. If <commit> on\r
+ one side is omitted, it will have the same effect as\r
+ using HEAD instead.\r
+</p>\r
+</dd>\r
+<dt>\r
+<em>git-diff</em> [--options] <commit>…<commit> [--] [<path>…]\r
+</dt>\r
+<dd>\r
+<p>\r
+ This form is to view the changes on the branch containing\r
+ and up to the second <commit>, starting at a common ancestor\r
+ of both <commit>. "git-diff A…B" is equivalent to\r
+ "git-diff $(git-merge-base A B) B". You can omit any one\r
+ of <commit>, which has the same effect as using HEAD instead.\r
</p>\r
</dd>\r
</dl>\r
noted that all of the <commit> in the above description can be\r
any <tree-ish>.</p>\r
<p>For a more complete list of ways to spell <commit>, see\r
-"SPECIFYING REVISIONS" section in <a href="git-rev-parse.html">git-rev-parse(1)</a>.</p>\r
+"SPECIFYING REVISIONS" section in <a href="git-rev-parse.html">git-rev-parse(1)</a>.\r
+However, "diff" is about comparing two _endpoints_, not ranges,\r
+and the range notations ("<commit>..<commit>" and\r
+"<commit>…<commit>") do not mean a range as defined in the\r
+"SPECIFYING RANGES" section in <a href="git-rev-parse.html">git-rev-parse(1)</a>.</p>\r
</div>\r
<h2>OPTIONS</h2>\r
<div class="sectionbody">\r
</ol>\r
</dd>\r
<dt>\r
+Comparing branches\r
+</dt>\r
+<dd>\r
+<div class="listingblock">\r
+<div class="content">\r
+<pre><tt>$ git diff topic master <b>(1)</b>\r
+$ git diff topic..master <b>(2)</b>\r
+$ git diff topic...master <b>(3)</b></tt></pre>\r
+</div></div>\r
+<ol>\r
+<li>\r
+<p>\r
+Changes between the tips of the topic and the master branches.\r
+</p>\r
+</li>\r
+<li>\r
+<p>\r
+Same as above.\r
+</p>\r
+</li>\r
+<li>\r
+<p>\r
+Changes that occured on the master branch since when the topic\r
+branch was started off it.\r
+</p>\r
+</li>\r
+</ol>\r
+</dd>\r
+<dt>\r
Limiting the diff output\r
</dt>\r
<dd>\r
</div>\r
<div id="footer">\r
<div id="footer-text">\r
-Last updated 02-Aug-2007 07:23:08 UTC\r
+Last updated 28-Aug-2007 06:25:09 UTC\r
</div>\r
</div>\r
</body>\r
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 gitlink: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 is untracked,
+compare the two files / directories. This behavior can be
+forced by --no-index.
'git-diff' [--options] --cached [<commit>] [--] [<path>...]::
'git-diff' [--options] <commit> <commit> [--] [<path>...]::
- This form is to view the changes between two <commit>,
- for example, tips of two branches.
+ This is to view the changes between two arbitrary
+ <commit>.
+
+'git-diff' [--options] <commit>..<commit> [--] [<path>...]::
+
+ This is synonymous to the previous form. If <commit> on
+ one side is omitted, it will have the same effect as
+ using HEAD instead.
+
+'git-diff' [--options] <commit>...<commit> [--] [<path>...]::
+
+ This form is to view the changes on the branch containing
+ and up to the second <commit>, starting at a common ancestor
+ of both <commit>. "git-diff A...B" is equivalent to
+ "git-diff $(git-merge-base A B) B". You can omit any one
+ of <commit>, which has the same effect as using HEAD instead.
Just in case if you are doing something exotic, it should be
noted that all of the <commit> in the above description can be
For a more complete list of ways to spell <commit>, see
"SPECIFYING REVISIONS" section in gitlink:git-rev-parse[1].
-
+However, "diff" is about comparing two _endpoints_, not ranges,
+and the range notations ("<commit>..<commit>" and
+"<commit>...<commit>") do not mean a range as defined in the
+"SPECIFYING RANGES" section in gitlink:git-rev-parse[1].
OPTIONS
-------
file "test".
<3> Compare the version before the last commit and the last commit.
+Comparing branches::
++
+------------
+$ git diff topic master <1>
+$ git diff topic..master <2>
+$ git diff topic...master <3>
+------------
++
+<1> Changes between the tips of the topic and the master branches.
+<2> Same as above.
+<3> Changes that occured on the master branch since when the topic
+branch was started off it.
Limiting the diff output::
+
<key-id></tt> is used. When <tt>-u <key-id></tt> is not used, the\r
committer identity for the current user is used to find the\r
GnuPG key for signing.</p>\r
-<p><tt>-d <tag></tt> deletes the tag.</p>\r
-<p><tt>-v <tag></tt> verifies the gpg signature of the tag.</p>\r
-<p><tt>-l <pattern></tt> lists tags with names that match the given pattern\r
-(or all if no pattern is given).</p>\r
</div>\r
<h2>OPTIONS</h2>\r
<div class="sectionbody">\r
</div>\r
<div id="footer">\r
<div id="footer-text">\r
-Last updated 11-Aug-2007 08:29:16 UTC\r
+Last updated 28-Aug-2007 06:25:09 UTC\r
</div>\r
</div>\r
</body>\r
committer identity for the current user is used to find the
GnuPG key for signing.
-`-d <tag>` deletes the tag.
-
-`-v <tag>` verifies the gpg signature of the tag.
-
-`-l <pattern>` lists tags with names that match the given pattern
-(or all if no pattern is given).
-
OPTIONS
-------
-a::
</dt>\r
<dd>\r
<p>\r
- Same as --git-dir=<tt>pwd</tt>.\r
+ Treat the repository as a bare repository. If GIT_DIR\r
+ environment is not set, it is set to the current working\r
+ directory.\r
</p>\r
</dd>\r
</dl>\r
</div>\r
<div id="footer">\r
<div id="footer-text">\r
-Last updated 21-Aug-2007 02:20:20 UTC\r
+Last updated 28-Aug-2007 06:25:11 UTC\r
</div>\r
</div>\r
</body>\r
variable.
--bare::
- Same as --git-dir=`pwd`.
+ Treat the repository as a bare repository. If GIT_DIR
+ environment is not set, it is set to the current working
+ directory.
+
FURTHER DOCUMENTATION
---------------------