Skip to content

Instantly share code, notes, and snippets.

@zheileman
Last active February 28, 2022 14:19
Show Gist options
  • Save zheileman/96d5046347340dcec591bcabc0d5acd6 to your computer and use it in GitHub Desktop.
Save zheileman/96d5046347340dcec591bcabc0d5acd6 to your computer and use it in GitHub Desktop.
Git-crypt and GPG stuff
# List my keys:
gpg --list-keys
# Search and import a key:
gpg --search-keys [email or key ID]
# Trust a key
gpg --edit-key ID
trust
5 = I trust ultimately
y
quit
# Install
brew install git-crypt
# git-cryp init repository (only NEW repos)
cd repo
git-crypt init
# Add a key to the repo:
git-crypt add-gpg-user [email or key ID]
# After cloning a repository with encrypted files, unlock with with GPG:
git-crypt unlock
# Distributing a key to a public server
gpg --keyserver pgp.mit.edu --send-key [email or key ID]
gpg --keyserver pool.sks-keyservers.net --send-key [email or key ID]
# NOTE: If you get errors with the keyserver, try another one! for example: keyserver.ubuntu.com or keys.openpgp.org
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment