]> git.ipfire.org Git - thirdparty/git.git/blobdiff - Documentation/git-commit.txt
userdiff: support Markdown
[thirdparty/git.git] / Documentation / git-commit.txt
index 76281932847ba95197894a6b972ef3cb157a40ba..a3baea32aedddfa00077adc5f2a2b36e38a5ea26 100644 (file)
@@ -13,7 +13,8 @@ SYNOPSIS
           [-F <file> | -m <msg>] [--reset-author] [--allow-empty]
           [--allow-empty-message] [--no-verify] [-e] [--author=<author>]
           [--date=<date>] [--cleanup=<mode>] [--[no-]status]
-          [-i | -o] [-S[<keyid>]] [--] [<file>...]
+          [-i | -o] [--pathspec-from-file=<file> [--pathspec-file-nul]]
+          [-S[<keyid>]] [--] [<pathspec>...]
 
 DESCRIPTION
 -----------
@@ -278,22 +279,37 @@ FROM UPSTREAM REBASE" section in linkgit:git-rebase[1].)
        already been staged. If used together with `--allow-empty`
        paths are also not required, and an empty commit will be created.
 
+--pathspec-from-file=<file>::
+       Pathspec is passed in `<file>` instead of commandline args. If
+       `<file>` is exactly `-` then standard input is used. Pathspec
+       elements are separated by LF or CR/LF. Pathspec elements can be
+       quoted as explained for the configuration variable `core.quotePath`
+       (see linkgit:git-config[1]). See also `--pathspec-file-nul` and
+       global `--literal-pathspecs`.
+
+--pathspec-file-nul::
+       Only meaningful with `--pathspec-from-file`. Pathspec elements are
+       separated with NUL character and all other characters are taken
+       literally (including newlines and quotes).
+
 -u[<mode>]::
 --untracked-files[=<mode>]::
        Show untracked files.
 +
+--
 The mode parameter is optional (defaults to 'all'), and is used to
 specify the handling of untracked files; when -u is not used, the
 default is 'normal', i.e. show untracked files and directories.
-+
+
 The possible options are:
-+
+
        - 'no'     - Show no untracked files
        - 'normal' - Shows untracked files and directories
        - 'all'    - Also shows individual files in untracked directories.
-+
+
 The default can be changed using the status.showUntrackedFiles
 configuration variable documented in linkgit:git-config[1].
+--
 
 -v::
 --verbose::
@@ -332,26 +348,23 @@ changes to tracked files.
 
 -S[<keyid>]::
 --gpg-sign[=<keyid>]::
+--no-gpg-sign::
        GPG-sign commits. The `keyid` argument is optional and
        defaults to the committer identity; if specified, it must be
-       stuck to the option without a space.
-
---no-gpg-sign::
-       Countermand `commit.gpgSign` configuration variable that is
-       set to force each and every commit to be signed.
+       stuck to the option without a space. `--no-gpg-sign` is useful to
+       countermand both `commit.gpgSign` configuration variable, and
+       earlier `--gpg-sign`.
 
 \--::
        Do not interpret any more arguments as options.
 
-<file>...::
-       When files are given on the command line, the command
-       commits the contents of the named files, without
-       recording the changes already staged.  The contents of
-       these files are also staged for the next commit on top
-       of what have been staged before.
-
-:git-commit: 1
-include::date-formats.txt[]
+<pathspec>...::
+       When pathspec is given on the command line, commit the contents of
+       the files that match the pathspec without recording the changes
+       already added to the index. The contents of these files are also
+       staged for the next commit on top of what have been staged before.
++
+For more details, see the 'pathspec' entry in linkgit:gitglossary[7].
 
 EXAMPLES
 --------
@@ -446,6 +459,43 @@ alter the order the changes are committed, because the merge
 should be recorded as a single commit.  In fact, the command
 refuses to run when given pathnames (but see `-i` option).
 
+COMMIT INFORMATION
+------------------
+
+Author and committer information is taken from the following environment
+variables, if set:
+
+       GIT_AUTHOR_NAME
+       GIT_AUTHOR_EMAIL
+       GIT_AUTHOR_DATE
+       GIT_COMMITTER_NAME
+       GIT_COMMITTER_EMAIL
+       GIT_COMMITTER_DATE
+
+(nb "<", ">" and "\n"s are stripped)
+
+The author and committer names are by convention some form of a personal name
+(that is, the name by which other humans refer to you), although Git does not
+enforce or require any particular form. Arbitrary Unicode may be used, subject
+to the constraints listed above. This name has no effect on authentication; for
+that, see the `credential.username` variable in linkgit:git-config[1].
+
+In case (some of) these environment variables are not set, the information
+is taken from the configuration items `user.name` and `user.email`, or, if not
+present, the environment variable EMAIL, or, if that is not set,
+system user name and the hostname used for outgoing mail (taken
+from `/etc/mailname` and falling back to the fully qualified hostname when
+that file does not exist).
+
+The `author.name` and `committer.name` and their corresponding email options
+override `user.name` and `user.email` if set and are overridden themselves by
+the environment variables.
+
+The typical usage is to set just the `user.name` and `user.email` variables;
+the other options are provided for more complex use cases.
+
+:git-commit: 1
+include::date-formats.txt[]
 
 DISCUSSION
 ----------