Skip to content

Instantly share code, notes, and snippets.

@Samk13
Created February 21, 2026 13:12
Show Gist options
  • Select an option

  • Save Samk13/c51fa71870d4d74f490e6a49d0e36f9e to your computer and use it in GitHub Desktop.

Select an option

Save Samk13/c51fa71870d4d74f490e6a49d0e36f9e to your computer and use it in GitHub Desktop.
Setup GPG key mac

See: https://github.com/microsoft/vscode/wiki/Commit-Signing

brew install gpg2 gnupg pinentry-mac

mkdir -p ~/.gnupg

echo "pinentry-program $(brew --prefix)/bin/pinentry-mac"
echo "pinentry-program $(brew --prefix)/bin/pinentry-mac" >> ~/.gnupg/gpg-agent.conf
echo "use-agent" >> ~/.gnupg/gpg.conf
echo 'export GPG_TTY=$(tty)' >> ~/.zprofile

gpg --full-generate-key

(1) RSA and RSA
What keysize do you want? (3072) 4096
Key is valid for? (0)
Is this correct? (y/N) y

Real name: 
Email address:
Comment:

---

gpg --armor --export <id>

git config --global user.signingkey <id>
git config --global commit.gpgsign true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment