The commit created by plain --fixup=
<commit> has a subject
-composed of "fixup!" followed by the subject line from <commit>,
+composed of "fixup!" followed by the subject line from <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
@@ -576,7 +576,7 @@ commit, but the additional commentary will be thrown away once the
The commit created by --fixup=amend:
<commit> is similar but its
subject is instead prefixed with "amend!". The log message of
-<commit> is copied into the log message of the "amend!" commit and
+<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
@@ -586,7 +586,7 @@ specified.
--fixup=reword:
<commit> is shorthand for --fixup=amend:
<commit>
---only
. It creates an "amend!" commit with only a log message
+ --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.
@@ -597,84 +597,84 @@ without making any other changes.
See
git-rebase(1) for details.
-
--squash=<commit>
+
--squash=
<commit>
-Construct a commit message for use with rebase
--autosquash
.
+
Construct a commit message for use with git
rebase
--autosquash
.
The commit message subject line is taken from the specified
commit with a prefix of "squash! ". Can be used with additional
commit message options (-m
/-c
/-C
/-F
). See
git-rebase(1) for details.
-
--reset-author
+
--reset-author
-When used with -C/-c/--amend options, or when committing after a
+
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
+
--short
When doing a dry-run, give the output in the short-format. See
git-status(1) for details. Implies --dry-run
.
-
--branch
+
--branch
Show the branch and tracking info even in short-format.
-
--porcelain
+
--porcelain
When doing a dry-run, give the output in a porcelain-ready
format. See git-status(1) for details. Implies
--dry-run
.
-
--long
+
--long
When doing a dry-run, give the output in the long-format.
Implies --dry-run
.
-
-z
-
--null
+
-z
+
--null
When showing short
or porcelain
status output, print the
-filename verbatim and terminate the entries with NUL, instead of LF.
+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 git-config(1)).
-
-F <file>
-
--file=<file>
+
-F
<file>
+
--file=
<file>
-Take the commit message from the given file. Use - to
+
Take the commit message from <file>. Use - to
read the message from the standard input.
-
--author=<author>
+
--author=
<author>
Override the commit author. Specify an explicit author using the
-standard A
U
Thor
<author@example.com
> format. Otherwise <author>
+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. rev-list --all -i --author=<author>);
+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>
+
--date=
<date>
Override the author date used in the commit.
-
-m <msg>
-
--message=<msg>
+
-m
<msg>
+
--message=
<msg>
-Use the given <msg> as the commit message.
+
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>
+
-t
<file>
+
--template=
<file>
When editing the commit message, start the editor with the
-contents in the given file. The commit.template
configuration
+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
@@ -682,9 +682,9 @@ 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.
-
-s
-
--signoff
-
--no-signoff
+
-s
+
--signoff
+
--no-signoff
Add a Signed-off-by
trailer by the committer at the end of the commit
log message. The meaning of a signoff depends on the project
@@ -697,77 +697,75 @@ Linux kernel and Git projects.) Consult the documentation or
leadership of the project to which you’re contributing to
understand how the signoffs are used in that project.
-
The --no-signoff option can be used to countermand an earlier --signoff
+
The --no-signoff
option can be used to countermand an earlier --signoff
option on the command line.
-
--trailer <token>[(=|:)<value>]
+
--trailer
<token>[(=
|:
)<value>]
-Specify a (<token>, <value>) pair that should be applied as a
+
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.)
+<committer@example.com
>" will add the Signed-off-by
trailer
+and the Helped-by
trailer to the commit message.)
The trailer.
* configuration variables
(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
+
-n
+
--
[no-
]verify
-By default, the pre-commit and commit-msg hooks are run.
-When any of --no-verify
or -n
is given, these are bypassed.
+
Bypass the pre-commit
and commit-msg
hooks.
See also githooks(5).
-
--allow-empty
+
--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
+
--allow-empty-message
-Like --allow-empty this command is primarily for use by foreign
-SCM interface scripts. It allows you to create a commit with an
-empty commit message without using plumbing commands like
-git-commit-tree(1).
+Create a commit with an empty commit message without using plumbing
+commands like git-commit-tree(1). Like --allow-empty
, this
+command is primarily for use by foreign SCM interface scripts.
-
--cleanup=<mode>
+
--cleanup=
<mode>
-This option determines how the supplied commit message should be
+
Determine how the supplied commit message should be
cleaned up before committing. The <mode> can be strip
,
whitespace
, verbatim
, scissors
or default
.
-- strip
+strip
-
Strip leading and trailing empty lines, trailing whitespace,
commentary and collapse consecutive empty lines.
-- whitespace
+whitespace
-
Same as strip
except #commentary is not removed.
-- verbatim
+verbatim
-
Do not change the message at all.
-- scissors
+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.
+"#" can be customized with core.commentChar
.
# ------------------------ >8 ------------------------
-- default
+default
-
Same as strip
if the message is to be edited.
Otherwise whitespace
.
@@ -781,21 +779,20 @@ Otherwise whitespace
.
variable (see git-config(1)).
-
-e
-
--edit
+
-e
+
--edit
-The message taken from file with -F
, command line with
--m
, and from commit object with -C
are usually used as
-the commit log message unmodified. This option lets you
-further edit the message taken from these sources.
+Let the user further edit the message taken from <file>
+with -F
<file>, command line with -m
<message>, and
+from <commit> with -C
<commit>.
-
--no-edit
+
--no-edit
Use the selected commit message without launching an editor.
For example, git
commit
--amend
--no-edit
amends a commit
without changing its commit message.
-
--amend
+
--amend
Replace the tip of the current branch by creating a new
commit. The recorded tree is prepared as usual (including
@@ -829,26 +826,26 @@ amend a commit that has already been published. (See the "RECOVERING
FROM UPSTREAM REBASE" section in git-rebase(1).)
-
--no-post-rewrite
+
--no-post-rewrite
-Bypass the post-rewrite hook.
+Bypass the post-rewrite
hook.
-
-i
-
--include
+
-i
+
--include
Before making a commit out of staged contents so far,
stage the contents of paths given on the command line
as well. This is usually not what you want unless you
are concluding a conflicted merge.
-
-o
-
--only
+
-o
+
--only
Make a commit by taking the updated working tree contents
of the paths specified on the
command line, disregarding any contents that have been
staged for other paths. This is the default mode of operation of
-git commit if any paths are given on the command line,
+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
no paths need to be specified, which can be used to amend
@@ -856,66 +853,69 @@ the last commit without committing 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>
+
--pathspec-from-file=
<file>
-Pathspec is passed in <file> instead of commandline args. If
+
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
+elements are separated by LF or CR/LF. Pathspec elements can be
quoted as explained for the configuration variable core.quotePath
(see git-config(1)). See also --pathspec-file-nul
and
global --literal-pathspecs
.
-
--pathspec-file-nul
+
--pathspec-file-nul
Only meaningful with --pathspec-from-file
. Pathspec elements are
-separated with NUL character and all other characters are taken
+separated with NUL character and all other characters are taken
literally (including newlines and quotes).
-
-u[<mode>]
-
--untracked-files[=<mode>]
+
-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 <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.
-
-
+
+
+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
+The default can be changed using the status.showUntrackedFiles
configuration variable documented in git-config(1).
-
-v
-
--verbose
+
-v
+
--verbose
-Show unified diff between the HEAD commit and what
+
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
+lines prefixed with #. This diff will not be a part
of the commit message. See the commit.verbose
configuration
variable in git-config(1).
@@ -924,47 +924,47 @@ what would be committed and the worktree files, i.e. the unstaged
changes to tracked files.
-
-q
-
--quiet
+
-q
+
--quiet
Suppress commit summary message.
-
--dry-run
+
--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
+
--status
Include the output of 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.
+configuration variable commit.status
.
-
--no-status
+
--no-status
Do not include the output of git-status(1) in the
commit message template when using an editor to prepare the
default commit message.
-
-S[<keyid>]
-
--gpg-sign[=<keyid>]
-
--no-gpg-sign
+
-S
[<key-id>]
+
--gpg-sign
[=
<key-id>]
+
--no-gpg-sign
-GPG-sign commits. The keyid
argument is optional and
+
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>…
+
<pathspec>...
-When pathspec is given on the command line, commit the contents of
+
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.
@@ -982,10 +982,10 @@ staged for the next commit on top of what have been staged before.
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
+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
+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
@@ -1017,7 +1017,7 @@ $ git commit -a
The command git
commit
-a
first looks at your working tree,
-notices that you have modified hello.c and removed goodbye.c,
+notices that you have modified hello.c
and removed goodbye.c
,
and performs necessary git
add
and git
rm
for you.
@@ -1050,13 +1050,13 @@ sequence, if you do:
hello.h
as expected.
-
After a merge (initiated by git merge or git pull) stops
+
After a merge (initiated by git
merge
or git
pull
) stops
because of conflicts, cleanly merged
paths are already staged to be committed for you, and paths that
conflicted are left in unmerged state. You would have to first
-check which paths are conflicting with git status
+check which paths are conflicting with git
status
and after fixing them manually in your working tree, you would
-stage the result as usual with git add:
+stage the result as usual with
git
add
:
@@ -1093,15 +1093,27 @@ refuses to run when given pathnames (but see
-i
option).
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
-
+
+
+-
+
GIT_AUTHOR_NAME
+
+-
+
GIT_AUTHOR_EMAIL
+
+-
+
GIT_AUTHOR_DATE
+
+-
+
GIT_COMMITTER_NAME
+
+-
+
GIT_COMMITTER_EMAIL
+
+-
+
GIT_COMMITTER_DATE
+
+
(nb "<", ">" and "\n"s are stripped)
@@ -1116,7 +1128,7 @@ that, see the
credential.username
variable in
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,
+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).
@@ -1244,7 +1256,7 @@ mind.
-
-
git commit and git commit-tree issue
+
git
commit
and git
commit-tree
issue
a warning if the commit log message given to it does not look
like a valid UTF-8 string, unless you explicitly say your
project uses a legacy encoding. The way to say this is to
@@ -1263,7 +1275,7 @@ implies that the commit log message is encoded in UTF-8.
-git log, git show, git blame and friends look at the
+
git
log
, git
show
, git
blame
and friends look at the
encoding
header of a commit object, and try to re-code the
log message into UTF-8 unless otherwise specified. You can
specify the desired output encoding with
@@ -1294,7 +1306,7 @@ reversible operation.
The editor used to edit the commit log message will be chosen from the
-GIT_EDITOR
environment variable, the core.editor configuration variable, the
+GIT_EDITOR
environment variable, the core.editor
configuration variable, the
VISUAL
environment variable, or the EDITOR
environment variable (in that
order). See git-var(1) for details.
@@ -1305,17 +1317,17 @@ same as what’s found there:
-- commit.cleanup
+commit.cleanup
-
This setting overrides the default of the --cleanup
option in
-git
commit
. See git-commit(1) for details. Changing the
-default can be useful when you always want to keep lines that begin
+git
commit
. Changing the default can be useful
+when you always want to keep lines that begin
with the comment character # in your log message, in which case you
would do git
config
commit.cleanup
whitespace
(note that you will
have to remove the help lines that begin with # in the commit log
template yourself, if you do this).
-- commit.gpgSign
+commit.gpgSign
-
A boolean to specify whether all commits should be GPG signed.
Use of this option when doing operations such as rebase can
@@ -1323,21 +1335,21 @@ result in a large number of commits being signed. It may be
convenient to use an agent to avoid typing your GPG passphrase
several times.
-- commit.status
+commit.status
-
A boolean to enable/disable inclusion of status information in the
commit message template when using an editor to prepare the commit
-message. Defaults to true.
+message. Defaults to true
.
-- commit.template
+commit.template
-
Specify the pathname of a file to use as the template for
new commit messages.
-- commit.verbose
+commit.verbose
-
A boolean or int to specify the level of verbosity with git
commit
.
-See git-commit(1).
+
@@ -1393,7 +1405,7 @@ overwritten by the next invocation of git
commit
.