diff options
Diffstat (limited to 'Documentation/git-commit.txt')
-rw-r--r-- | Documentation/git-commit.txt | 50 |
1 files changed, 30 insertions, 20 deletions
diff --git a/Documentation/git-commit.txt b/Documentation/git-commit.txt index 9ec6b3cc17..f970a43422 100644 --- a/Documentation/git-commit.txt +++ b/Documentation/git-commit.txt @@ -29,7 +29,8 @@ The content to be added can be specified in several ways: 2. by using 'git rm' to remove files from the working tree and the index, again before using the 'commit' command; -3. by listing files as arguments to the 'commit' command, in which +3. by listing files as arguments to the 'commit' command + (without --interactive or --patch switch), in which case the commit will ignore changes staged in the index, and instead record the current content of the listed files (which must already be known to Git); @@ -41,7 +42,8 @@ The content to be added can be specified in several ways: actual commit; 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, + to decide one by one which files or hunks should be part of the commit + in addition to contents in the index, before finalizing the operation. See the ``Interactive Mode'' section of linkgit:git-add[1] to learn how to operate these modes. @@ -75,7 +77,7 @@ OPTIONS -c <commit>:: --reedit-message=<commit>:: - Like '-C', but with '-c' the editor is invoked, so that + Like '-C', but with `-c` the editor is invoked, so that the user can further edit the commit message. --fixup=<commit>:: @@ -93,7 +95,7 @@ OPTIONS --reset-author:: When used with -C/-c/--amend options, or when committing after a - a conflicting cherry-pick, declare that the authorship of the + conflicting cherry-pick, declare that the authorship of the resulting commit now belongs to the committer. This also renews the author timestamp. @@ -110,14 +112,17 @@ OPTIONS `--dry-run`. --long:: - When doing a dry-run, give the output in a the long-format. + When doing a dry-run, give the output in the long-format. Implies `--dry-run`. -z:: --null:: - When showing `short` or `porcelain` status output, terminate - entries in the status output with NUL, instead of LF. If no - format is given, implies the `--porcelain` output format. + When showing `short` or `porcelain` status output, print the + filename verbatim and terminate the entries with NUL, instead of LF. + If no format is given, implies the `--porcelain` output format. + Without the `-z` option, filenames with "unusual" characters are + quoted as explained for the configuration variable `core.quotePath` + (see linkgit:git-config[1]). -F <file>:: --file=<file>:: @@ -139,6 +144,8 @@ OPTIONS Use the given <msg> as the commit message. If multiple `-m` options are given, their values are concatenated as separate paragraphs. ++ +The `-m` option is mutually exclusive with `-c`, `-C`, and `-F`. -t <file>:: --template=<file>:: @@ -191,17 +198,18 @@ whitespace:: verbatim:: Do not change the message at all. scissors:: - Same as `whitespace`, except that everything from (and - including) the line - "`# ------------------------ >8 ------------------------`" - is truncated if the message is to be edited. "`#`" can be - customized with core.commentChar. + Same as `whitespace` except that everything from (and including) + the line found below is truncated, if the message is to be edited. + "`#`" can be customized with core.commentChar. + + # ------------------------ >8 ------------------------ + default:: Same as `strip` if the message is to be edited. Otherwise `whitespace`. -- + -The default can be changed by the 'commit.cleanup' configuration +The default can be changed by the `commit.cleanup` configuration variable (see linkgit:git-config[1]). -e:: @@ -260,10 +268,11 @@ FROM UPSTREAM REBASE" section in linkgit:git-rebase[1].) staged for other paths. This is the default mode of operation of 'git commit' if any paths are given on the command line, in which case this option can be omitted. - If this option is specified together with '--amend', then + If this option is specified together with `--amend`, then no paths need to be specified, which can be used to amend the last commit without committing changes that have - already been staged. + already been staged. If used together with `--allow-empty` + paths are also not required, and an empty commit will be created. -u[<mode>]:: --untracked-files[=<mode>]:: @@ -290,7 +299,8 @@ configuration variable documented in linkgit:git-config[1]. what changes the commit has. Note that this diff output doesn't have its lines prefixed with '#'. This diff will not be a part - of the commit message. + of the commit message. See the `commit.verbose` configuration + variable in linkgit:git-config[1]. + If specified twice, show in addition the unified diff between what would be committed and the worktree files, i.e. the unstaged @@ -449,14 +459,14 @@ include::i18n.txt[] ENVIRONMENT AND CONFIGURATION VARIABLES --------------------------------------- The editor used to edit the commit log message will be chosen from the -GIT_EDITOR environment variable, the core.editor configuration variable, the -VISUAL environment variable, or the EDITOR environment variable (in that +`GIT_EDITOR` environment variable, the core.editor configuration variable, the +`VISUAL` environment variable, or the `EDITOR` environment variable (in that order). See linkgit:git-var[1] for details. HOOKS ----- This command can run `commit-msg`, `prepare-commit-msg`, `pre-commit`, -and `post-commit` hooks. See linkgit:githooks[5] for more +`post-commit` and `post-rewrite` hooks. See linkgit:githooks[5] for more information. FILES |