Merge branch 'nd/maint-compat-fnmatch-fix' into maint
[gitweb.git] / Documentation / git-commit.txt
index 9e327cf5c0921e9c7c3a7858b216ef276d4eaf71..15cec8601c6953e2526ca8d7ffcbee491885875a 100644 (file)
@@ -42,7 +42,7 @@ The content to be added can be specified in several ways:
 
 5. by using the --interactive or --patch switches with the 'commit' command
    to decide one by one which files or hunks should be part of the commit,
-   before finalizing the operation. See the ``Interactive Mode`` section of
+   before finalizing the operation. See the ``Interactive Mode'' section of
    linkgit:git-add[1] to learn how to operate these modes.
 
 The `--dry-run` option can be used to obtain a
@@ -184,6 +184,11 @@ OPTIONS
        commit log message unmodified.  This option lets you
        further edit the message taken from these sources.
 
+--no-edit::
+       Use the selected commit message without launching an editor.
+       For example, `git commit --amend --no-edit` amends a commit
+       without changing its commit message.
+
 --amend::
        Used to amend the tip of the current branch. Prepare the tree
        object you would want to replace the latest commit as usual
@@ -294,7 +299,7 @@ When recording your own work, the contents of modified files in
 your working tree are temporarily stored to a staging area
 called the "index" with 'git add'.  A file can be
 reverted back, only in the index but not in the working tree,
-to that of the last commit with `git reset HEAD \-- <file>`,
+to that of the last commit with `git reset HEAD -- <file>`,
 which effectively reverts 'git add' and prevents the changes to
 this file from participating in the next commit.  After building
 the state to be committed incrementally with these commands,
@@ -388,8 +393,10 @@ DISCUSSION
 Though not required, it's a good idea to begin the commit message
 with a single short (less than 50 character) line summarizing the
 change, followed by a blank line and then a more thorough description.
-Tools that turn commits into email, for example, use the first line
-on the Subject: line and the rest of the commit in the body.
+The text up to the first blank line in a commit message is treated
+as the commit title, and that title is used throughout git.
+For example, linkgit:git-format-patch[1] turns a commit into email, and it uses
+the title on the Subject line and the rest of the commit in the body.
 
 include::i18n.txt[]
 
@@ -406,6 +413,15 @@ This command can run `commit-msg`, `prepare-commit-msg`, `pre-commit`,
 and `post-commit` hooks.  See linkgit:githooks[5] for more
 information.
 
+FILES
+-----
+
+`$GIT_DIR/COMMIT_EDITMSG`::
+       This file contains the commit message of a commit in progress.
+       If `git commit` exits due to an error before creating a commit,
+       any commit message that has been provided by the user (e.g., in
+       an editor session) will be available in this file, but will be
+       overwritten by the next invocation of `git commit`.
 
 SEE ALSO
 --------