The Developer Certificate of Origin (DCO) check ensures all commits are signed off. If your PR fails the DCO check, here’s how to fix it.
-
Go to your Pull Request → Commits tab.
-
Click the ⋯ menu → Edit commit message.
-
Add this line at the end of the commit message:
Signed-off-by: Your Name <your.email@example.com> -
Save changes → GitHub will create a new commit with sign-off.
-
Re-run the DCO check.
- Open your branch in GitHub Desktop.
- Go to Repository → Repository Settings → Commit Behavior.
- Check ✅ Always sign-off commits.
- Amend the last commit:
- Right-click the commit → Amend Commit.
- Save again with sign-off enabled.
- Push with force (if required):
git push --force-with-lease
- Enable sign-off in your config:
git config --global user.name "Your Name" git config --global user.email "your.email@example.com" - Re-sign commits interactively:
Replace N with the number of commits to fix. Mark commits as edit, then run:
git rebase -i HEAD~Ngit commit --amend --signoff git rebase --continue - Push with:
git push --force-with-lease
- Simplest fix: squash all commits into a single new signed commit (via Desktop or CLI).
- Alternatively, ask a maintainer to Squash and Merge with a sign-off on merge.
This ensures you’ll never fail DCO again.
- Use the -s flag when committing from CLI:
git commit -s -m "Your commit message" - Turn on Always sign-off commits in your client (GitHub Desktop or Git CLI).
-
GitHub Desktop Turn on Always sign-off commits in your client.
-
Git CLI You can always sign-off commits automatically using a commit template (NOTE: This will only work if you use enter your commit message interactively with
git commit, and will not work withgit commit -m "<message>"):- Create ~/.git-commit-template.txt with:
Signed-off-by: Your Name <your.email@example.com> -
Tell Git to use it:
git config --global commit.template ~/.git-commit-template.txt
-