Skip to content

Instantly share code, notes, and snippets.

@lucko
Last active April 15, 2024 08:26
Show Gist options
  • Save lucko/bc2ba1f684bdce2b8cdcd8442e541e0e to your computer and use it in GitHub Desktop.
Save lucko/bc2ba1f684bdce2b8cdcd8442e541e0e to your computer and use it in GitHub Desktop.
Auto-sign commits with IntelliJ on MacOS

Run:

  • brew install gnupg pinentry-mac
  • git config --global user.signingkey <key>
  • git config --global commit.gpgsign true
  • git config --global gpg.program gpg

Then add the following line to ~/.gnupg/gpg-agent.conf:

pinentry-program /usr/local/bin/pinentry-mac

or, if using the new Homebrew location:

pinentry-program /opt/homebrew/bin/pinentry-mac
@louis-jaris
Copy link

Thanks, super helpful 🙌

I had to restart my gpg-agent after applying the configuration change: gpgconf --kill gpg-agent (no need to restart it - it will be restarted automatically as soon as you try to interact with your keys, e.g. gpg --list-secret-keys --keyid-format long)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment