Home Explore Blog CI



git

2nd chunk of `Documentation/git-commit.adoc`
79f82e548b6787fcb24b8bf77ec53db2cc4c44790f27d3930000000100000fa3
 (including the timestamp)
	when creating the commit.

`-c <commit>`::
`--reedit-message=<commit>`::
	Like `-C`, but with `-c` the editor is invoked, so that
	the user can further edit the commit message.

`--fixup=[(amend|reword):]<commit>`::
	Create a new commit which "fixes up" _<commit>_ when applied with
	`git rebase --autosquash`. Plain `--fixup=<commit>` creates a
	"fixup!" commit which changes the content of _<commit>_ but leaves
	its log message untouched. `--fixup=amend:<commit>` is similar but
	creates an "amend!" commit which also replaces the log message of
	_<commit>_ with the log message of the "amend!" commit.
	`--fixup=reword:<commit>` creates an "amend!" commit which
	replaces the log message of _<commit>_ with its own log message
	but makes no changes to the content of _<commit>_.
+
The commit created by plain `--fixup=<commit>` has a title
composed of "fixup!" followed by the title of _<commit>_,
and is recognized specially by `git rebase --autosquash`. The `-m`
option may be used to supplement the log message of the created
commit, but the additional commentary will be thrown away once the
"fixup!" commit is squashed into _<commit>_ by
`git rebase --autosquash`.
+
The commit created by `--fixup=amend:<commit>` is similar but its
title is instead prefixed with "amend!". The log message of
_<commit>_ is copied into the log message of the "amend!" commit and
opened in an editor so it can be refined. When `git rebase
--autosquash` squashes the "amend!" commit into _<commit>_, the
log message of _<commit>_ is replaced by the refined log message
from the "amend!" commit. It is an error for the "amend!" commit's
log message to be empty unless `--allow-empty-message` is
specified.
+
`--fixup=reword:<commit>` is shorthand for `--fixup=amend:<commit>
 --only`. It creates an "amend!" commit with only a log message
(ignoring any changes staged in the index). When squashed by `git
rebase --autosquash`, it replaces the log message of _<commit>_
without making any other changes.
+
Neither "fixup!" nor "amend!" commits change authorship of
_<commit>_ when applied by `git rebase --autosquash`.
See linkgit:git-rebase[1] for details.

`--squash=<commit>`::
	Construct a commit message for use with `git rebase --autosquash`.
	The commit message title is taken from the specified
	commit with a prefix of "squash! ".  Can be used with additional
	commit message options (`-m`/`-c`/`-C`/`-F`). See
	linkgit:git-rebase[1] for details.

`--reset-author`::
	When used with `-C`/`-c`/`--amend` options, or when committing after a
	conflicting cherry-pick, declare that the authorship of the
	resulting commit now belongs to the committer. This also renews
	the author timestamp.

`--short`::
	When doing a dry-run, give the output in the short-format. See
	linkgit:git-status[1] for details. Implies `--dry-run`.

`--branch`::
	Show the branch and tracking info even in short-format.

`--porcelain`::
	When doing a dry-run, give the output in a porcelain-ready
	format. 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

Title: Git Commit Options
Summary
The git-commit command provides various options to customize the commit process, including specifying the commit message, author, and content, as well as options for interactive patch selection, fixup commits, and squashing commits, allowing for flexible and precise control over the commit process.