1
0
mirror of synced 2025-12-23 21:07:12 -05:00
Files
docs/content/authentication/managing-commit-signature-verification/associating-an-email-with-your-gpg-key.md

2.9 KiB

title, intro, redirect_from, versions, topics, shortTitle
title intro redirect_from versions topics shortTitle
Associating an email with your GPG key Your GPG key must be associated with a verified email that matches your committer identity.
/articles/associating-an-email-with-your-gpg-key
/github/authenticating-to-github/associating-an-email-with-your-gpg-key
/github/authenticating-to-github/managing-commit-signature-verification/associating-an-email-with-your-gpg-key
fpt ghes ghec
* * *
Identity
Access management
Associate email with GPG key

If you're using a GPG key that matches your committer identity and your verified email address associated with your account on {% data variables.location.product_location %}, then you can begin signing commits and signing tags.

{% data reusables.command_line.open_the_multi_os_terminal %} {% data reusables.gpg.list-keys-with-note %} {% data reusables.gpg.copy-gpg-key-id %}

  1. Enter gpg --edit-key GPG key ID, substituting in the GPG key ID you'd like to use. In the following example, the GPG key ID is 3AA5C34371567BD2:

    gpg --edit-key 3AA5C34371567BD2
    
  2. Enter gpg> adduid to add the user ID details.

    gpg> adduid
    
  3. Follow the prompts to supply your real name, email address, and any comments. You can modify your entries by choosing N, C, or E. {% data reusables.gpg.private-email %} {% ifversion fpt or ghec %} For more information, see AUTOTITLE.{% endif %}

    Real Name: OCTOCAT
    Email address: "octocat@github.com"
    Comment: GITHUB-KEY
    Change (N)ame, (C)omment, (E)mail or (O)kay/(Q)uit?
    
  4. Enter O to confirm your selections.

  5. Enter your key's passphrase.

  6. Enter gpg> save to save the changes

    gpg> save
    
  7. Enter gpg --armor --export GPG key ID, substituting in the GPG key ID you'd like to use. In the following example, the GPG key ID is 3AA5C34371567BD2:

    $ gpg --armor --export 3AA5C34371567BD2
    # Prints the GPG key, in ASCII armor format
    
  8. Upload the GPG key by adding it to your GitHub account.

Further reading