Answer the question
In order to leave comments, you need to log in
PhpStorm can't sign git commit. Why?
Commits are signed by gpg. When trying to make a commit (or a merge commit, as in the screenshot) using the gui in PhpStorm, an error occurs:
gpg failed to sign the data
failed to write commit object
2021-10-07 12:32:35,737 [8688771] INFO - 4idea.branch.GitMergeOperation - starting
2021-10-07 12:32:35,737 [8688771] INFO - 4idea.branch.GitMergeOperation - next repository: \\wsl$ \Ubuntu-20.04\home\user\projects\*************hid**********
2021-10-07 12:32:35,797 [8688831] INFO - #git4idea.commands .GitHandler - [***********hid**********] git -c core.quotepath=false -c log.showSignature=false merge master
2021-10-07 12:32 :35,837 [8688871] INFO - #git4idea.commands.GitHandler - error: gpg failed to sign the data
2021-10-07 12:32:35,837 [8688871] INFO - #git4idea.commands.GitHandler - fatal: failed to write commit object
2021-10-07 12:32:35,857 [8688891] INFO - 4idea.branch.GitMergeOperation - Unknown error. {128}
echo "test" | gpg --clearsign
Answer the question
In order to leave comments, you need to log in
just follow the instructions
https://docs.github.com/en/authentication/managing... (it worked for me, windows 10)
Figured out my problem. To be able to sign a commit with a password-protected gpg key, you need to specify the path for the pinentry program (the program for entering the gpg password).
1. Install gpg on host windows. Download here https://gnupg.org/ Gpg4win installer. In fact, from the entire installed gpg, we need one file.
2. In the wsl subsystem, in the home directory there are false files with the following content:
[email protected]:~$ cat .gnupg/gpg.conf
no-tty
use-agent
[email protected]:~$ cat .gnupg/gpg-agent.conf
pinentry-program "/mnt/c/Program Files (x86)/GnuPG/bin/pinentry-basic.exe"
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question