i can't commit with IntelliJ and an activated gpg in config. Currently I can only do this with git bash manuel. I use windows and i found a lot of informations for OSX but that didn't helped me.
How can I use VCS in IntelliJ without doing anything about git bash?
This is the error from IntelliJ when i try to commit something.
11:52 Commit failed with error
0 files committed, 1 file failed to commit: update
gpg failed to sign the data
failed to write commit object
If there are no keys yet, you need to generate a new pair. Open Terminal / Command Prompt / GitBash / any other shell you have on your system and run the following command: gpg --full-generate-key (for pgp 2.1. 17 and below, use the gpg --gen-key command. Answer the questions that the tool will return.
You can disable this by running git config commit. gpgsign false This sets the configuration locally instead of globally.
IDE is not a terminal and cannot handle the prompt issue by gpg on the command line.
As a workaround, you could create a wrapper and tell git to use it as gpg app.
Wrapper code:
# file /home/user/gpg-no-tty.sh
#!/bin/bash
/usr/bin/gpg --batch --no-tty "$@"
and then set your git config for the repo where you want to gpg sign commits:
[gpg]
program = /home/user/gpg-no-tty.sh
See this comment for details
In Windows + (IntelliJ / AndroidStudio), your global git config should look like this:
user.name=<username>
user.email=<email>
user.signingkey=<key>
commit.gpgsign=true
gpg.program=<path to gpg.exe>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With