Skip to content

Instantly share code, notes, and snippets.

@lucko
Last active April 15, 2024 08:26
Show Gist options
  • Star 28 You must be signed in to star a gist
  • Fork 7 You must be signed in to fork a gist
  • 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
@enzok
Copy link

enzok commented Sep 6, 2019

I tried this and I get invalid option for both .conf files when running gpg-agent. Is gpg-agent even required for this solution?

@aliihsansepar
Copy link

thanks a lot, for saving my day!

@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