Skip to content

Instantly share code, notes, and snippets.

@s4nchez
Created March 28, 2018 21:37
Show Gist options
  • Save s4nchez/4f2741c8f750572e2af9efeb572aa865 to your computer and use it in GitHub Desktop.
Save s4nchez/4f2741c8f750572e2af9efeb572aa865 to your computer and use it in GitHub Desktop.
GPG signing and IntelliJ IDEA

The problem

By default, IntelliJ won't support the equivalent of git commit -S ... because that command expects a terminal to input the GPG passphrase.

The solution

Create a script that will perform the GPG signing on commits without a terminal:

gpg-no-tty.sh

#!/bin/bash
gpg --batch --no-tty "$@"

Reference that script in your gitconfig:

[commit]
        gpgsign = true
[gpg]
        program = /path/to/script/gpg-no-tty.sh

And that's it. Enjoy!

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