Sign your Git commits so 'Verified' really means something
Short answer: Anyone can set their Git name and email to anything, so a commit that says it's from your lead developer may not be. Signing commits fixes that: Git attaches a cryptographic signature made with the author's key, and GitHub and other hosts show a "Verified" badge when the signature matches a key on the author's account. The easiest route today is to sign with the SSH key you already use, set commit.gpgSign to true, and then require signed commits on your main branch.
Why commit authorship can't be trusted on its own
Git records an author name and email with every commit, taken from the local configuration on the machine that made it. Nothing checks it. A contractor's laptop, a compromised CI token or a careless copy of someone else's config can all produce commits that appear to come from a trusted person.
For most small teams that's never been a real problem. It matters more when:
- Several contractors or agencies work in one repository.
- You ship code to customers who ask about your development controls.
- Deploys happen automatically from the main branch, so whoever can push effectively controls production.
- You want a clear audit trail of who changed payment, login or permission code.
What signing gives you
GitHub's documentation explains that using GPG, SSH or S/MIME, you can sign tags and commits locally, and these are marked as verified so other people can be confident the changes came from a trusted source. The badge appears next to each commit in the web interface and in pull requests.
A signature proves that the holder of a specific private key made the commit, and that the commit hasn't been altered since. It doesn't prove the code is good, only who vouches for it.
Choosing a signing method
SSH keys. Most developers already have an SSH key for pushing to their Git host. Git can sign with it too: the gpg.format setting, whose default is openpgp, also accepts ssh and x509. Setup is quick and there's no new key to manage.
GPG keys. The traditional method. It's well supported and can carry expiry dates and subkeys, but it's more setup and more to explain to non-specialists.
S/MIME (x509) certificates. Useful in organisations that already issue certificates to staff, less common in small teams.
For most small businesses, SSH signing is the practical choice.
Setting it up with an SSH key
On each developer's machine:
- Tell Git to use SSH for signing: set
gpg.formattossh. - Point
user.signingKeyat the public key file you want to sign with. - Turn on signing for every commit: set
commit.gpgSigntotrue. Git's documentation notes this applies to all commits, including those created during operations like rebase. - Add the same public key to your account on the Git host as a signing key. On GitHub this is a separate key type from the authentication key, even if it's the same key file.
- Make sure the email in your Git config matches a verified email on your host account, or the badge won't show.
Make a test commit, push it to a branch and check that it shows as verified.
Signing in automated tools
Commits made by bots, CI pipelines or web editors need thought too:
- Commits made through your host's web interface are usually signed by the host itself.
- CI jobs that commit (for example, version bumps or generated files) need their own signing key stored as a secret, or should open a pull request for a human to merge instead.
- Merge strategies matter. A squash or rebase merge done on the host is signed by the host; a merge done locally is signed by whoever ran it.
Requiring signed commits
Once everyone signs, make it a rule. Most Git hosts offer a branch protection or ruleset option to require signed commits on chosen branches, so unsigned pushes are rejected.
GitHub also offers vigilant mode, which flags unsigned commits attributed to you as unverified. Its documentation notes vigilant mode is off by default. Turning it on makes impersonation more visible, at the cost of marking your own older unsigned commits.
Rolling it out without friction
- Pick a date and announce it a week ahead.
- Share a short setup guide with the exact commands for your team.
- Check every developer's first signed commit together.
- Turn on the branch requirement only after everyone's setup works.
- Add signing setup to onboarding for new developers and contractors.
- When someone leaves, remove their keys from the organisation along with their access.
Checking signatures yourself
You don't have to rely on the web badge. Locally, git log --show-signature prints the signature status of each commit, and git verify-commit checks a single one. For SSH signatures, Git needs an "allowed signers" file listing which key belongs to which email; without it, Git can tell that a commit is signed but not whose key it is. Keep that file in your team's shared configuration so anyone reviewing history locally sees the same answer as the host.
A worked example
Consider a hypothetical Auckland software firm building a booking platform with two in-house developers and an overseas agency. A customer's security questionnaire asked how they knew who changed production code. The team switched everyone to SSH commit signing, added each person's key as a signing key on their accounts, required signed commits on the main branch, and set the CI pipeline to open pull requests rather than commit directly. Their answer to the questionnaire became one honest sentence with a link to the branch rule.
FAQ
Do signed commits slow developers down?
After setup, signing is automatic and adds no noticeable time to committing.
What happens to old unsigned commits?
They stay as they are. Requiring signatures applies to new pushes.
Can I sign tags for releases?
Yes, and it's worth doing. A signed release tag lets customers or deploy tools confirm which version you actually released.
What if a developer loses their key?
Remove the old key from their account, create a new one, and add it as a signing key. Past commits keep their original verification status according to each host's rules.
If you'd like help tightening who can change code that reaches production, tell us how your team works today.