GIT-INTERPRET-TRAILERS(1) Git Manual GIT-INTERPRET-TRAILERS(1) (NAME) git-interpret-trailers - (SYNOPSIS) git interpret-trailers [--in-place] [--trim-empty] [(--trailer (|)[(=|:)])...] [--parse] [...] (DESCRIPTION) (trailer) RFC 822 . : subject Lorem ipsum dolor sit amet, consectetur adipiscing elit. Signed-off-by: Alice Signed-off-by: Bob Signed-off-by (trailer) . . --parse . trailer. ( ) ( --trailer=... ) . . git-format-patch(1) . ( ) --- (patch) . --no-divider . --trailer . . = : --trailer (, ) ( ). (trim) : key: value ": " ( ) . ( ) --trailer . trailer..key . . : trailer.sign.key "Signed-off-by: " --trailer="sign: foo" --trailer="Signed-off-by: foo" . . . . (i) (ii) . ( ) . --- ( ). (tab) . . "" (folding) RFC 822. : key: This is a very long value, with spaces and newlines in it. RFC 822 ( ). (encoding) . (OPTIONS) --in-place, --no-in-place (in-place) . --no-in-place . --trim-empty, --no-trim-empty . . --no-trim-empty . --trailer=[(=|:)], --no-trailer (, ) . . . --no-trailer . --where=, --no-where . --where trailer.where trailer..where --where --no-where --trailer . : after before end start. --no-where --where . --if-exists=, --no-if-exists . --if-exists trailer.ifExists trailer..ifExists --if-exists --no-if-exists --trailer . : addIfDifferent addIfDifferentNeighbor add replace doNothing. --no-if-exists --if-exists . --if-missing=, --no-if-missing . --if-missing trailer.ifMissing trailer..ifMissing --if-missing --no-if-missing --trailer . : doNothing add. --no-if-missing --if-missing . --only-trailers, --no-only-trailers . --no-only-trailers . --only-input, --no-only-input trailer. . --no-only-input . --unfold, --no-unfold ( "folded") . --no-unfold . --parse --only-trailers --only-input --unfold. --unfold . . --divider, --no-divider --- . . --no-divider ( git-format-patch(1)). (CONFIGURATION) git-config(1) . : trailer.separators . : = . . %=$ % = $ . % : % ( ). trailer.where . end ( ) start after before . end . start . after . before . trailer.ifexists . : addIfDifferentNeighbor ( ) addIfDifferent add replace doNothing. addIfDifferentNeighbor (, ) . addIfDifferent (, ) . add (, ) . replace . ( ) . doNothing . trailer.ifmissing . : add ( ) doNothing. add . doNothing . trailer..key ( ) . ( ) . git config trailer.ack.key "Acked-by" Acked-by ack . --trailer "ack:..." "ack" --trailer "Acked-by:..." . . : trailer.separators . . trailer..where trailer.where . trailer..ifexists trailer.ifexists . trailer..ifmissing trailer.ifmissing . trailer..command trailer..cmd. trailer..cmd . $ARG . $ARG $ARG . trailer..cmd trailer..command trailer..cmd trailer..command . trailer..cmd --trailer = . --trailer = git-interpret- trailers(1) . --trailer = . ( ) . --trailer = . (EXAMPLES) o sign Signed-off-by : $ git config trailer.sign.key "Signed-off-by" $ cat msg.txt subject body text $ git interpret-trailers --trailer 'sign: Alice ' --trailer 'sign: Bob ' Signed-off-by: Bob o --in-place : $ cat msg.txt subject body text Signed-off-by: Bob $ git interpret-trailers --trailer 'Acked-by: Alice ' --in-place msg.txt $ cat msg.txt subject body text Signed-off-by: Bob Acked-by: Alice o Cc Reviewed-by : $ git format-patch -1 0001-foo.patch $ git interpret-trailers --trailer 'Cc: Alice ' --trailer 'Reviewed-by: Bob ' 0001-foo.patch >0001-bar.patch o sign "Signed-off-by: " "Signed-off-by: " : $ cat msg1.txt subject body text $ git config trailer.sign.key "Signed-off-by: " $ git config trailer.sign.ifmissing add $ git config trailer.sign.ifexists doNothing $ git config trailer.sign.cmd 'echo "$(git config user.name) <$(git config user.email)>"' $ git interpret-trailers --trailer sign $ cat msg2.txt subject body text Signed-off-by: Alice $ git interpret-trailers --trailer sign o fix # : $ git config trailer.separators ":#" $ git config trailer.fix.key "Fix #" $ echo "subject" | git interpret-trailers --trailer fix=42 subject Fix #42 o help cmd glog-find-author : $ cat ~/bin/glog-find-author #!/bin/sh test -n "$1" && git log --author="$1" --pretty="%an <%ae>" -1 || true $ cat msg.txt subject body text $ git config trailer.help.key "Helped-by: " $ git config trailer.help.ifExists "addIfDifferentNeighbor" $ git config trailer.help.cmd "~/bin/glog-find-author" $ git interpret-trailers --trailer="help:Junio" --trailer="help:Couder" Helped-by: Christian Couder o ref cmd glog-grep (grep) : $ cat ~/bin/glog-grep #!/bin/sh test -n "$1" && git log --grep "$1" --pretty=reference -1 || true $ cat msg.txt subject body text $ git config trailer.ref.key "Reference-to: " $ git config trailer.ref.ifExists "replace" $ git config trailer.ref.cmd "~/bin/glog-grep" $ git interpret-trailers --trailer="ref:Add copyright notices." see : $ cat msg.txt subject body text see: HEAD~2 $ cat ~/bin/glog-ref #!/bin/sh git log -1 --oneline --format="%h (%s)" --abbrev-commit --abbrev=14 $ git config trailer.see.key "See-also: " $ git config trailer.see.ifExists "replace" $ git config trailer.see.ifMissing "doNothing" $ git config trailer.see.cmd "glog-ref" $ git interpret-trailers --trailer=see ( sed ) (hook) commit-msg git-interpret-trailers(1) git-version : $ cat temp.txt ***subject*** ***message*** Fixes: Z Cc: Z Reviewed-by: Z Signed-off-by: Z $ sed -e 's/ Z$/ /' temp.txt > commit_template.txt $ git config commit.template commit_template.txt $ cat .git/hooks/commit-msg #!/bin/sh git interpret-trailers --trim-empty --trailer "git-version: \$(git describe)" "\$1" > "\$1.new" mv "\$1.new" "\$1" $ chmod +x .git/hooks/commit-msg (SEE ALSO) git-commit(1), git-format-patch(1), git-config(1) (GIT) git(1) Git 2.55.0 2026-06-29 GIT-INTERPRET-TRAILERS(1)