Home Explore Blog CI



git

3rd chunk of `Documentation/git-commit.adoc`
d11f62cec0d8266229d1c71057df72c116b04a6f975b683a0000000100000fa0
 See linkgit:git-status[1] for details. Implies
	`--dry-run`.

`--long`::
	When doing a dry-run, give the output in the long-format.
	Implies `--dry-run`.

`-z`::
`--null`::
	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>`::
	Take the commit message from _<file>_.  Use '-' to
	read the message from the standard input.

`--author=<author>`::
	Override the commit author. Specify an explicit author using the
	standard `A U Thor <author@example.com>` format. Otherwise _<author>_
	is assumed to be a pattern and is used to search for an existing
	commit by that author (i.e. `git rev-list --all -i --author=<author>`);
	the commit author is then copied from the first such commit found.

`--date=<date>`::
	Override the author date used in the commit.

`-m <msg>`::
`--message=<msg>`::
	Use _<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>`::
	When editing the commit message, start the editor with the
	contents in _<file>_.  The `commit.template` configuration
	variable is often used to give this option implicitly to the
	command.  This mechanism can be used by projects that want to
	guide participants with some hints on what to write in the message
	in what order.  If the user exits the editor without editing the
	message, the commit is aborted.  This has no effect when a message
	is given by other means, e.g. with the `-m` or `-F` options.

include::signoff-option.adoc[]

`--trailer <token>[(=|:)<value>]`::
	Specify a (_<token>_, _<value>_) pair that should be applied as a
	trailer. (e.g. `git commit --trailer "Signed-off-by:C O Mitter \
	<committer@example.com>" --trailer "Helped-by:C O Mitter \
	<committer@example.com>"` will add the `Signed-off-by` trailer
	and the `Helped-by` trailer to the commit message.)
	The `trailer.*` configuration variables
	(linkgit:git-interpret-trailers[1]) can be used to define if
	a duplicated trailer is omitted, where in the run of trailers
	each trailer would appear, and other details.

`-n`::
`--[no-]verify`::
	Bypass the `pre-commit` and `commit-msg` hooks.
	See also linkgit:githooks[5].

`--allow-empty`::
	Usually recording a commit that has the exact same tree as its
	sole parent commit is a mistake, and the command prevents you
	from making such a commit.  This option bypasses the safety, and
	is primarily for use by foreign SCM interface scripts.

`--allow-empty-message`::
	Create a commit with an empty commit message without using plumbing
	commands like linkgit:git-commit-tree[1]. Like `--allow-empty`, this
	command is primarily for use by foreign SCM interface scripts.

`--cleanup=<mode>`::
	Determine how the supplied commit message should be
	cleaned up before committing.  The '<mode>' can be `strip`,
	`whitespace`, `verbatim`, `scissors` or `default`.
+
--
`strip`::
	Strip leading and trailing empty lines, trailing whitespace,
	commentary and collapse consecutive empty lines.
`whitespace`::
	Same as `strip` except #commentary is not removed.
`verbatim`::
	Do not change the message at all.
`scissors`::
	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
variable (see linkgit:git-config[1]).

`-e`::
`--edit`::
	Let the user further edit the

Title: Git Commit Message Options
Summary
The git-commit command provides various options to customize the commit message, including specifying the message, author, and date, as well as options for formatting, trailers, and bypassing hooks, allowing for precise control over the commit process and message content.