Skip to content

Instantly share code, notes, and snippets.

@saud978
Forked from o-can/gpg.conf
Created September 8, 2021 06:20
Show Gist options
  • Save saud978/8b19f9929dbde7f2830290c9c2f26d7d to your computer and use it in GitHub Desktop.
Save saud978/8b19f9929dbde7f2830290c9c2f26d7d to your computer and use it in GitHub Desktop.
Setting up GPG signature on Mac OS X with Xcode
# Add these lines
batch
passphrase-file <Full path to the key.txt file (without tilda)>
brew install gpg
gpg --gen-key
gpg --armor --export <email> > ~/.backups/gpg_git_public.key
gpg --armor --export-secret-key <email> > ~/.backups/gpg_git_private.key
chmod 600 ~/.backups/gpg_git_public.key
chomd 600 ~/.backups/gpg_git_private.key
gpg --list-secret-keys
# Copy the 8-digit id of the key (in the `sec` section)
git config --globa user.signingkey <8-digit key id>
git config --global commit.gpgsign true
vim ~/.gnupg/key.txt
# Put the passpharse for the GPG key to the first line of the file
chmod 600 ~/.gnupg/key.txt
vim ~/.gnupg/gpg.conf
# Add lines from the gpg.conf file of this gist
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment