You can sign commits and tags locally, so other people can verify that your work comes from a trusted source. If a commit or tag has a GPG or S/MIME signature that is cryptographically verifiable, GitHub marks the commit or tag as verified.
If a commit or tag has a signature that cannot be verified, GitHub marks the commit or tag as unverified.
Repository administrators can enforce required commit signing on a branch to block all commits that are not signed and verified. For more information, see "About protected branches."
You can check the verification status of your signed commits or tags on GitHub and view why your commit signatures might be unverified. For more information, see "Checking your commit and tag signature verification status."
GitHub will automatically use GPG to sign commits you make using the GitHub web interface, except for when you squash and merge a pull request that you are not the author of. You can optionally choose to have GitHub sign commits you make in Codespaces. Commits signed by GitHub will have a verified status on GitHub. You can verify the signature locally using the public key available at https://github.com/web-flow.gpg. For more information about enabling GPG verification for your codespaces, see "Managing GPG verification for Codespaces."
You can use GPG to sign commits with a GPG key that you generate yourself.
GitHub uses OpenPGP libraries to confirm that your locally signed commits and tags are cryptographically verifiable against a public key you have added to your GitHub account.
To sign commits using GPG and have those commits verified on GitHub, follow these steps:
- Check for existing GPG keys
- Generate a new GPG key
- Add a new GPG key to your GitHub account
- Tell Git about your signing key
- Sign commits
- Sign tags
You can use S/MIME to sign commits with an X.509 key issued by your organization.
GitHub uses the Debian ca-certificates package, the same trust store used by Mozilla browsers, to confirm that your locally signed commits and tags are cryptographically verifiable against a public key in a trusted root certificate.
Note: S/MIME signature verification is available in Git 2.19 or later. To update your version of Git, see the Git website.
To sign commits using S/MIME and have those commits verified on GitHub, follow these steps:
You don't need to upload your public key to GitHub.
Organizations and GitHub Apps that require commit signing can use bots to sign commits. If a commit or tag has a bot signature that is cryptographically verifiable, GitHub marks the commit or tag as verified.
Signature verification for bots will only work if the request is verified and authenticated as the GitHub App or bot and contains no custom author information, custom committer information, and no custom signature information, such as Commits API.