lfx-git-setup
Skill9 starsChanged 2 months agoMITView on GitHub
Interactive setup guide for LFX contributors to configure Git for DCO signoff and GPG-signed commits. Use this skill whenever someone asks about setting up Git signing, DCO signoff, GPG keys for commits, configuring `~/.gitconfig` for signing, adding a GPG key to GitHub, or any variation of "how do I sign my commits?". Also trigger it when a user says their commits aren't showing as "Verified" on GitHub, when they're onboarding to an LFX project and need to meet contribution requirements, or when they ask about `git commit -s`, `--signoff`, `Signed-off-by`, or `commit.gpgSign`. This skill works for technical and non-technical users alike.
In this repository23 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- .github/copilot-instructions.mdCopilot instructions
- copilot-code-reviewerSkill
- lfx-skills-code-reviewSkill
- lfx-cdp-snowflake-connectorsSkill
- lfx-data-engineerSkill
- lfx-general-code-reviewSkill
- lfx-intercomSkill
- lfx-itx-integrationSkill
- lfx-local-reviewSkill
- lfx-object-store-designSkill
- lfx-object-store-opsSkill
- lfx-platform-architectureSkill
- lfx-pr-catchupSkill
- lfx-pre-pr-reviewSkill
- lfx-pr-resolveSkill
- lfx-security-engineerSkill
- lfx-setupSkill
- lfxSkill
- lfx-snowflake-accessSkill
- lfx-test-journeySkill
- lfx-v2-ticket-writerSkill
The file
We split this skill into the rules it gives an agent
10 rules. About 0 are common, 8 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈8
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 34
Before doing anything else, check what operating system the user is on.
- Distinctive: line 37
Ask the user (or check their context):
- Distinctive: line 45
If it's unclear which platform they're on, just ask: "what operating system are you using, mac, linux, or windows?"
- Distinctive: line 75
phase 2, Generate GPG key: create your personal signing key.
- Very specific: line 99
Add a c shortcut (or something you will remember) to ~/.gitconfig so git c -m "..." does both automatically:
- Distinctive: line 171
Read the appropriate file based on the user's OS before walking them through setup.
- Distinctive: line 178
If the user is clearly a developer (mentions terminal, dotfiles, brew, apt, etc.), go straight to commands with brief explanations.
- Distinctive: line 180
If the user seems newer to the command line, explain what each command _does_ before showing it, and reassure them that these are one-time …
- Very specific: line 182
Never assume the user knows what GPG, DCO, or ~/.gitconfig are, briefly define each on first mention.
- Distinctive: line 184
After each phase, confirm it worked before moving on.
≈ “Common” is an estimate: at least 1 in 5 of the 213,895 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
<!-- Copyright The Linux Foundation and each contributor to LFX. --><!-- SPDX-License-Identifier: MIT -->LFX git Setup: DCO Signoff & GPG Signed Commits
This skill walks contributors through two essential git contribution requirements used across linux foundation projects:
- DCO signoff (
--signoff/-s), adds aSigned-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. - GPG signed commits (
-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.
Your First Step: Detect the User's Platform
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):
- macos → read
references/mac.mdfor the full walkthrough - linux (ubuntu, fedora, debian, arch, etc.) → read
references/linux.md - windows → read
references/windows.md, note this is a supported but less common setup path; wsl2 (windows subsystem for linux) users should follow linux steps
If it's unclear which platform they're on, just ask: "what operating system are you using, mac, linux, or windows?"
Overall Workflow (all platforms)
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 tooand a GPG key that:
- was generated with the same email address as your github account
- has its public key uploaded to GitHub (settings → ssh and gpg keys)
The DCO signoff (-s) is handled separately, see the DCO signoff section below.
The Four Phases
- phase 1, Prerequisites: install gpg tools and verify git version.
- phase 2, Generate GPG key: create your personal signing key.
- phase 3, Configure git: wire the key into
~/.gitconfig. - phase 4, Register with GitHub: upload your public key so github can verify.
Each platform reference file covers all four phases with exact commands.
DCO signoff
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>Option A: Always Sign Off Manually (simplest)
git commit -s -S -m "your commit message"Both flags together: -s for the DCO signoff, -S for GPG signature.
Option B: git alias (recommended for convenience)
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"
Option C: Global Commit Hook (fully automatic)
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.
Verifying Everything Works
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 -1You should see:
gpg: good signature from "your name <email>"in the output- a
Signed-off-by:line in the commit message
On GitHub, after pushing, the commit will show a green verified badge.
Troubleshooting Quick Reference
| 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 |
Platform Reference Files
- macos:
references/mac.md - linux:
references/linux.md - windows / wsl2:
references/windows.md
Read the appropriate file based on the user's OS before walking them through setup.
Communication Style
This skill serves both technical and non-technical users. Adjust your tone:
- If the user is clearly a developer (mentions terminal, dotfiles, brew, apt, etc.), go straight to commands with brief explanations.
- If the user seems newer to the command line, explain what each command does before showing it, and reassure them that these are one-time setup steps.
- Never assume the user knows what GPG, DCO, or
~/.gitconfigare, briefly define each on first mention. - After each phase, confirm it worked before moving on. ask: "Did that complete without errors?" before proceeding.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

