Skip to content

Instantly share code, notes, and snippets.

@mauricios
Created August 31, 2018 16:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mauricios/6a4eb563c3ebaebe93ab67b83758138f to your computer and use it in GitHub Desktop.
Save mauricios/6a4eb563c3ebaebe93ab67b83758138f to your computer and use it in GitHub Desktop.
GPG useful commands

Generate the GPG key pair

gpg --full-generate-key;

Export public GPG key

Look for your Key ID in using the following command:

gpg --list-secret-keys --keyid-format LONG

Use the Key ID to get the Publick Key:

gpg --armor --export <GPG key ID>

Export private GPG key

If you need to export your private GPG key (to move to a different machine), use the following command:

gpg --export-secret-keys -a <GPG key ID>

Add a new colaborator

To add a colaborator GPG public key you need first to import the key into your local key chain:

gpg --import gpg_public.key

See the ID of the new added key:

gpg --list-keys

Then add the key ID to the git crypt users

git-crypt add-gpg-user --trusted <GPG key ID>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment