Autogenerated HTML docs for v1.1.6-g5a79
[git.git] / git-commit.html
index 44e85ed..f391cff 100644 (file)
@@ -3,7 +3,7 @@
 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">\r
 <head>\r
 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />\r
-<meta name="generator" content="AsciiDoc 7.0.1" />\r
+<meta name="generator" content="AsciiDoc 7.0.2" />\r
 <style type="text/css">\r
 /* Debug borders */\r
 p, li, dt, dd, div, pre, h1, h2, h3, h4, h5, h6 {\r
@@ -273,8 +273,8 @@ git-commit(1) Manual Page
 <h2>SYNOPSIS</h2>\r
 <div class="sectionbody">\r
 <div class="verseblock">\r
-<div class="content"><em>git-commit</em> [-a] [-s] [-v] [(-c | -C) &lt;commit&gt; | -F &lt;file&gt; | -m &lt;msg&gt;]\r
-           [-e] [--] &lt;file&gt;&#8230;</div></div>\r
+<div class="content"><em>git-commit</em> [-a] [-i] [-s] [-v] [(-c | -C) &lt;commit&gt; | -F &lt;file&gt; | -m &lt;msg&gt;]\r
+           [-e] [--author &lt;author&gt;] [--] &lt;file&gt;&#8230;</div></div>\r
 </div>\r
 <h2>DESCRIPTION</h2>\r
 <div class="sectionbody">\r
@@ -321,6 +321,15 @@ information.</p>
 </p>\r
 </dd>\r
 <dt>\r
+--author &lt;author&gt;\r
+</dt>\r
+<dd>\r
+<p>\r
+        Override the author name used in the commit.  Use\r
+        <tt>A U Thor &lt;author@example.com&gt;</tt> format.\r
+</p>\r
+</dd>\r
+<dt>\r
 -m &lt;msg&gt;\r
 </dt>\r
 <dd>\r
@@ -369,6 +378,17 @@ information.</p>
 </p>\r
 </dd>\r
 <dt>\r
+-i|--include\r
+</dt>\r
+<dd>\r
+<p>\r
+        Instead of committing only the files specified on the\r
+        command line, update them in the index file and then\r
+        commit the whole index.  This is the traditional\r
+        behaviour.\r
+</p>\r
+</dd>\r
+<dt>\r
 &#8212;\r
 </dt>\r
 <dd>\r
@@ -381,13 +401,64 @@ information.</p>
 </dt>\r
 <dd>\r
 <p>\r
-        Update specified paths in the index file before committing.\r
+        Commit only the files specified on the command line.\r
+        This format cannot be used during a merge, nor when the\r
+        index and the latest commit does not match on the\r
+        specified paths to avoid confusion.\r
 </p>\r
 </dd>\r
 </dl>\r
 <p>If you make a commit and then found a mistake immediately after\r
 that, you can recover from it with <a href="git-reset.html">git-reset(1)</a>.</p>\r
 </div>\r
+<h2>Discussion</h2>\r
+<div class="sectionbody">\r
+<p><tt>git commit</tt> without _any_ parameter commits the tree structure\r
+recorded by the current index file.  This is a whole-tree commit\r
+even the command is invoked from a subdirectory.</p>\r
+<p><tt>git commit --include paths&#8230;</tt> is equivalent to</p>\r
+<div class="literalblock">\r
+<div class="content">\r
+<pre><tt>git update-index --remove paths...\r
+git commit</tt></pre>\r
+</div></div>\r
+<p>That is, update the specified paths to the index and then commit\r
+the whole tree.</p>\r
+<p><tt>git commit paths&#8230;</tt> largely bypasses the index file and\r
+commits only the changes made to the specified paths.  It has\r
+however several safety valves to prevent confusion.</p>\r
+<ol>\r
+<li>\r
+<p>\r
+It refuses to run during a merge (i.e. when\r
+  <tt>$GIT_DIR/MERGE_HEAD</tt> exists), and reminds trained git users\r
+  that the traditional semantics now needs -i flag.\r
+</p>\r
+</li>\r
+<li>\r
+<p>\r
+It refuses to run if named <tt>paths&#8230;</tt> are different in HEAD\r
+  and the index (ditto about reminding).  Added paths are OK.\r
+  This is because an earlier <tt>git diff</tt> (not <tt>git diff HEAD</tt>)\r
+  would have shown the differences since the last <tt>git\r
+  update-index paths&#8230;</tt> to the user, and an inexperienced user\r
+  may mistakenly think that the changes between the index and\r
+  the HEAD (i.e. earlier changes made before the last <tt>git\r
+  update-index paths&#8230;</tt> was done) are not being committed.\r
+</p>\r
+</li>\r
+<li>\r
+<p>\r
+It reads HEAD commit into a temporary index file, updates the\r
+  specified <tt>paths&#8230;</tt> and makes a commit.  At the same time,\r
+  the real index file is also updated with the same <tt>paths&#8230;</tt>.\r
+</p>\r
+</li>\r
+</ol>\r
+<p><tt>git commit --all</tt> updates the index file with _all_ changes to\r
+the working tree, and makes a whole-tree commit, regardless of\r
+which subdirectory the command is invoked in.</p>\r
+</div>\r
 <h2>Author</h2>\r
 <div class="sectionbody">\r
 <p>Written by Linus Torvalds &lt;torvalds@osdl.org&gt; and\r
@@ -399,7 +470,7 @@ Junio C Hamano &lt;junkio@cox.net&gt;</p>
 </div>\r
 <div id="footer">\r
 <div id="footer-text">\r
-Last updated 21-Jan-2006 23:50:16 PDT\r
+Last updated 07-Feb-2006 08:04:29 UTC\r
 </div>\r
 </div>\r
 </body>\r