path: root/Documentation/git-commit.txt
diff options
authorZheNing Hu <>2021-03-23 13:55:57 (GMT)
committerJunio C Hamano <>2021-03-23 17:31:38 (GMT)
commit2daae3d1d1bf513f1e1c00f1e4df75e1cb500e0f (patch)
tree80c488543732db29ca376021d7fe39dcbe4f6e29 /Documentation/git-commit.txt
parent142430338477d9d1bb25be66267225fb58498d92 (diff)
commit: add --trailer option
Historically, Git has supported the 'Signed-off-by' commit trailer using the '--signoff' and the '-s' option from the command line. But users may need to provide other trailer information from the command line such as "Helped-by", "Reported-by", "Mentored-by", Now implement a new `--trailer <token>[(=|:)<value>]` option to pass other trailers to `interpret-trailers` and insert them into commit messages. Signed-off-by: ZheNing Hu <> Signed-off-by: Junio C Hamano <>
Diffstat (limited to 'Documentation/git-commit.txt')
1 files changed, 13 insertions, 1 deletions
diff --git a/Documentation/git-commit.txt b/Documentation/git-commit.txt
index 17150fa..3fe7ef3 100644
--- a/Documentation/git-commit.txt
+++ b/Documentation/git-commit.txt
@@ -14,7 +14,8 @@ SYNOPSIS
[--allow-empty-message] [--no-verify] [-e] [--author=<author>]
[--date=<date>] [--cleanup=<mode>] [--[no-]status]
[-i | -o] [--pathspec-from-file=<file> [--pathspec-file-nul]]
- [-S[<keyid>]] [--] [<pathspec>...]
+ [(--trailer <token>[(=|:)<value>])...] [-S[<keyid>]]
+ [--] [<pathspec>...]
@@ -166,6 +167,17 @@ The `-m` option is mutually exclusive with `-c`, `-C`, and `-F`.
+--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 \
+ <>" --trailer "Helped-by:C O Mitter \
+ <>"` 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.
This option bypasses the pre-commit and commit-msg hooks.