Created
March 7, 2026 00:42
-
-
Save ghostwriter/85d32bace365e625c3db0dce0cbe7e1a to your computer and use it in GitHub Desktop.
Automatically adds a Signed-off-by line to the message.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/sh | |
| set -o pipefail | |
| set -o errtrace | |
| set -o nounset | |
| set -o errexit | |
| # Automatically add a Signed-off-by line to the message. | |
| SOB="Signed-off-by: $(git config user.name) <$(git config user.email)>" | |
| grep -qs "^$SOB" "$1" || echo "\n\n$SOB" >> "$1" |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
https://git-scm.com/docs/githooks#_commit_msg
Copy the above code and run the following commands at the root of the git repo.
pbpaste > .git/hooks/commit-msgchmod +x .git/hooks/commit-msgprofit!