Skip to main content
GitHub Docs
  • All products
  • Authentication
    • Account security
      • Authentication to GitHub
      • Create a strong password
      • Update access credentials
      • Create a PAT
      • Reviewing your SSH keys
      • Deploy keys
      • Authorizing OAuth Apps
      • Authorizing GitHub Apps
      • Authorized integrations
      • Third-party applications
      • Review OAuth apps
      • Token expiration
      • Security log
      • Remove sensitive data
      • About anonymized URLs
      • GitHub's IP addresses
      • SSH key fingerprints
      • Sudo mode
      • Unauthorized access
    • Secure your account with 2FA
      • About 2FA
      • Configure 2FA
      • Configure 2FA recovery
      • Access GitHub with 2FA
      • Recover an account with 2FA
      • Change 2FA delivery method
      • Countries supporting SMS
      • Disable 2FA
    • Connect with SSH
      • About SSH
      • Check for existing SSH key
      • Generate new SSH key
      • Add a new SSH key
      • Test your SSH connection
      • SSH key passphrases
    • Troubleshooting SSH
      • Use SSH over HTTPS port
      • Recover SSH key passphrase
      • Deleted or missing SSH keys
      • Permission denied (publickey)
      • Error: Bad file number
      • Error: Key already in use
      • Permission denied other-user
      • Permission denied other-repo
      • Agent failure to sign
      • ssh-add: illegal option -- K
      • SSL certificate problem
      • Error: Unknown key type
      • SSH key audit
    • Verify commit signatures
      • Commit signature verification
      • Displaying verification for all commits
      • Existing GPG keys
      • Generating a new GPG key
      • Add a GPG key
      • Tell Git your signing key
      • Associate email with GPG key
      • Signing commits
      • Signing tags
    • Troubleshoot verification
      • Check verification status
      • Use verified email in GPG key
  • Authentication/
  • Verify commit signatures/
  • Add a GPG key
 
GitHub Docs
  • Authentication/
  • Verify commit signatures/
  • Add a GPG key
Authentication
    • Get started
    • Account and profile
    • Authentication
    • Repositories
    • Enterprise administrators
    • Billing and payments
    • Site policy
    • Organizations
    • Code security
    • Pull requests
    • GitHub Issues
    • GitHub Actions
    • GitHub Copilot
    • GitHub Codespaces
    • GitHub Packages
    • Search on GitHub
    • Developers
    • REST API
    • GraphQL API
    • GitHub CLI
    • GitHub Discussions
    • GitHub Sponsors
    • Building communities
    • GitHub Pages
    • Education
    • GitHub Desktop
    • GitHub Support
    • Atom
    • Electron
    • CodeQL
    • npm
Free, Pro, & Team
    • Free, Pro, & Team
    • Enterprise Cloud
    • Enterprise Server 3.6
    • Enterprise Server 3.5
    • Enterprise Server 3.4
    • Enterprise Server 3.3
    • Enterprise Server 3.2
    • GitHub AE
    • All Enterprise Server releases
    • About versions

 

Adding a GPG key to your GitHub account

In this article

  • About addition of GPG keys to your account
  • Adding a GPG key
  • Further reading

To configure your account on GitHub.com to use your new (or existing) GPG key, you'll also need the key to your account.

About addition of GPG keys to your account

To sign commits associated with your account on GitHub, you can add a public GPG key to your personal account. Before you add a key, you should check for existing keys. If you don't find any existing keys, you can generate and copy a new key. For more information, see "Checking for existing GPG keys" and "Generating a new GPG key."

You can add multiple public keys to your account on GitHub. Commits signed by any of the corresponding private keys will show as verified. If you remove a public key, any commits signed by the corresponding private key will no longer show as verified.

To verify as many of your commits as possible, you can add expired and revoked keys. If the key meets all other verification requirements, commits that were previously signed by any of the corresponding private keys will show as verified and indicate that their signing key is expired or revoked.

A verified commit whose key expired

Supported GPG key algorithms

GitHub supports several GPG key algorithms. If you try to add a key generated with an unsupported algorithm, you may encounter an error.

  • RSA
  • ElGamal
  • DSA
  • ECDH
  • ECDSA
  • EdDSA

When verifying a signature, GitHub extracts the signature and attempts to parse its key ID. The key ID is then matched with keys added to GitHub. Until a matching GPG key is added to GitHub, it cannot verify your signatures.

Adding a GPG key

  1. In the upper-right corner of any page, click your profile photo, then click Settings.

    Settings icon in the user bar

  2. In the "Access" section of the sidebar, click SSH and GPG keys.

  3. Click New GPG key. GPG Key button

  4. In the "Key" field, paste the GPG key you copied when you generated your GPG key. The key field

  5. Click Add GPG key. The Add key button

  6. To confirm the action, enter your GitHub password.

Further reading

  • "Checking for existing GPG keys"
  • "Generating a new GPG key"
  • "Telling Git about your signing key"
  • "Associating an email with your GPG key"
  • "Signing commits and tags using GPG keys"
  • "About commit signature verification"

Did this doc help you?

Privacy policy

Help us make these docs great!

All GitHub docs are open source. See something that's wrong or unclear? Submit a pull request.

Make a contribution

Or, learn how to contribute.

Still need help?

Ask the GitHub community
Contact support
  • © 2022 GitHub, Inc.
  • Terms
  • Privacy
  • Security
  • Status
  • Help
  • Contact GitHub
  • Pricing
  • Developer API
  • Training
  • Blog
  • About