$ git config --global trailer.consent.key "Author-Rebase-Consent: " $ git config --global trailer.consent.cmd 'echo "https://No-rebase.github.io" && : ' $ git config --global trailer.consent.ifExists "replace"Part 2. Per-repository commit message hook:
cat >> .git/hooks/commit-msg <<-"EOF" #!/bin/sh git interpret-trailers --trim-empty --trailer "consent:no" "$1" > "$1.new" mv "$1.new" "$1" EOF chmod +x .git/hooks/commit-msgPart 2b. Commit message hook improved:
It is possible to automatically add the commit_msg hook to every cloned repo, using a repo template.
See the "TEMPLATE DIRECTORY" section of git-init, and the 'init.templateDir
' config variable.
Also see the interpret-trailers man page.