<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
<h2>SYNOPSIS</h2>\r
<div class="sectionbody">\r
<div class="verseblock">\r
-<div class="content"><em>git-commit</em> [-a] [-s] [-v] [(-c | -C) <commit> | -F <file> | -m <msg>]\r
- [-e] [--] <file>…</div></div>\r
+<div class="content"><em>git-commit</em> [-a] [-i] [-s] [-v] [(-c | -C) <commit> | -F <file> | -m <msg>]\r
+ [-e] [--author <author>] [--] <file>…</div></div>\r
</div>\r
<h2>DESCRIPTION</h2>\r
<div class="sectionbody">\r
</p>\r
</dd>\r
<dt>\r
+--author <author>\r
+</dt>\r
+<dd>\r
+<p>\r
+ Override the author name used in the commit. Use\r
+ <tt>A U Thor <author@example.com></tt> format.\r
+</p>\r
+</dd>\r
+<dt>\r
-m <msg>\r
</dt>\r
<dd>\r
</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
—\r
</dt>\r
<dd>\r
</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…</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…</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…</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…</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…</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…</tt> and makes a commit. At the same time,\r
+ the real index file is also updated with the same <tt>paths…</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 <torvalds@osdl.org> and\r
</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