Home Explore Blog CI



git

5th chunk of `Documentation/git-commit.adoc`
4cd34b73ab4851bdeaad9810b15db528a60545f38a385d2f0000000100000fa1
 changes that have
	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>`::
	Pass pathspec 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.

All usual spellings for Boolean value `true` are taken as `normal`
and `false` as `no`.
The default can be changed using the `status.showUntrackedFiles`
configuration variable documented in linkgit:git-config[1].
--

`-v`::
`--verbose`::
	Show unified diff between the `HEAD` commit and what
	would be committed at the bottom of the commit message
	template to help the user describe the commit by reminding
	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. 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
changes to tracked files.

`-q`::
`--quiet`::
	Suppress commit summary message.

`--dry-run`::
	Do not create a commit, but show a list of paths that are
	to be committed, paths with local changes that will be left
	uncommitted and paths that are untracked.

`--status`::
	Include the output of linkgit:git-status[1] in the commit
	message template when using an editor to prepare the commit
	message.  Defaults to on, but can be used to override
	configuration variable `commit.status`.

`--no-status`::
	Do not include the output of linkgit:git-status[1] in the
	commit message template when using an editor to prepare the
	default commit message.

`-S[<key-id>]`::
`--gpg-sign[=<key-id>]`::
`--no-gpg-sign`::
	GPG-sign commits. The _<key-id>_ is optional and
	defaults to the committer identity; if specified, it must be
	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.

`<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
--------
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 restore --staged <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,
`git commit` (without any pathname parameter) is used to record what
has been staged so far.  This is the most basic form of the
command.  An

Title: Git Commit Command Options and Usage
Summary
The git-commit command provides various options to customize the commit process, including handling untracked files, showing diffs, and GPG signing, as well as specifying paths to commit and overriding configuration variables, allowing users to tailor the commit process to their needs and workflows.