A pre-commit hook that automatically adds a DCO Signed-off-by` line to your commit messages using your Git committer identity.
Add to your .pre-commit-config.yaml:
- repo: https://github.com/nineyards-robotics/dco-sign-off
rev: v1.0.0
hooks:
- id: dco-sign-offThen install the hook:
pre-commit install --hook-type prepare-commit-msgThe hook runs at the prepare-commit-msg stage, so it needs the --hook-type flag since pre-commit defaults to the pre-commit stage.
When you make a commit, the hook checks if a Signed-off-by: line is already present. If not, it appends one using the name and email from your Git config (equivalent to git commit -s).
See LICENSE.