Help us improve
Share bugs, ideas, or general feedback.
From lfx-skills
Walks LFX contributors through configuring Git DCO signoff and GPG-signed commits with a step-by-step guide for macOS, Linux, and Windows.
npx claudepluginhub linuxfoundation/lfx-skills --plugin lfx-skillsHow this skill is triggered — by the user, by Claude, or both
Slash command
/lfx-skills:lfx-git-setupThis skill is limited to the following tools:
The summary Claude sees in its skill listing — used to decide when to auto-load this skill
<!-- Copyright The Linux Foundation and each contributor to LFX. -->
Guides technical evaluation of code review feedback: read fully, restate for understanding, verify against codebase, respond with reasoning or pushback before implementing.
Share bugs, ideas, or general feedback.
This skill walks contributors through two essential git contribution requirements used across linux foundation projects:
--signoff / -s), adds a
Signed-off-by: your name <email> line to every commit, certifying you wrote
the code and have the right to contribute it under the project's license. This
is a legal agreement, not just a formality.-S), cryptographically signs each commit with your
personal GPG key so GitHub can display a green "verified" badge, proving the
commit genuinely came from you.Before doing anything else, check what operating system the user is on. The steps are meaningfully different across platforms.
Ask the user (or check their context):
references/mac.md for the full walkthroughreferences/linux.mdreferences/windows.md, note this is a supported but less
common setup path; wsl2 (windows subsystem for linux) users should follow
linux stepsIf it's unclear which platform they're on, just ask: "what operating system are you using, mac, linux, or windows?"
The end goal is a ~/.gitconfig that looks roughly like this:
[user]
name = your full name
email = your-github-verified-email@example.com
signingkey = abc123def456 # your gpg key id
[commit]
gpgSign = true # auto-sign every commit with -S (GPG signing)
[tag]
gpgSign = true # auto-sign tags too
and a GPG key that:
The DCO signoff (-s) is handled separately, see the DCO signoff section below.
~/.gitconfig.Each platform reference file covers all four phases with exact commands.
The DCO (--signoff or -s) flag is separate from gpg signing. it adds this line to your commit message:
Signed-off-by: your name <your-email@example.com>
git commit -s -S -m "your commit message"
Both flags together: -s for the DCO signoff, -S for GPG signature.
Add a c shortcut (or something you will remember) to ~/.gitconfig so git c -m "..." does both automatically:
An example would be:
git config --global alias.c 'commit -s -S'
Then use: git c -m "your commit message"
This approach automatically appends Signed-off-by to every commit message,
even in GUI tools:
# create global hooks directory
mkdir -p ~/.git-hooks
# create the hook script
cat > ~/.git-hooks/prepare-commit-msg << 'eof'
#!/bin/sh
# Auto-add DCO Signed-off-by line
sob=$(git var git_author_ident | sed -n 's/^\(.*>\).*$/Signed-off-by: \1/p')
grep -Fqs "^$sob" "$1" || echo "$sob" >> "$1"
eof
# Make the git hook executable
chmod +x ~/.git-hooks/prepare-commit-msg
# Tell git to use this global hooks directory
git config --global core.hookspath ~/.git-hooks
⚠️ Note: the global hook applies to ALL repositories on your machine. If you work on non-lfx projects, you may prefer option A or B instead.
Once setup is complete, do a test commit:
# in any git repository
git commit -s -S --allow-empty -m "test: verify DCO and gpg signing setup"
git log --show-signature -1
You should see:
gpg: good signature from "your name <email>" in the outputSigned-off-by: line in the commit messageOn GitHub, after pushing, the commit will show a green verified badge.
| problem | likely cause | fix |
|---|---|---|
error: gpg failed to sign the data | gpg agent issue | run export GPG_TTY=$(tty) and retry |
| no verified badge on github | key not uploaded or wrong email | check key email matches github verified email |
secret key not available | key id mismatch | re-run git config --global user.signingkey <id> |
| DCO check failing in ci | missing signed-off-by | amend last commit: git commit --amend -s |
| gpg prompts not appearing | missing pinentry | see platform reference file for pinentry setup |
gpg: signing failed: inappropriate ioctl | tty not set | add export GPG_TTY=$(tty) to your shell profile |
references/mac.mdreferences/linux.mdreferences/windows.mdRead the appropriate file based on the user's OS before walking them through setup.
This skill serves both technical and non-technical users. Adjust your tone:
~/.gitconfig are, briefly
define each on first mention.