I can't disable enter passphrase each time, how I make commit.
I install and set Gpg4win → I move to folder with .git
subfolder →
git add .
,git commit -m "Any description"
.Succsessful signed commit without entering passphrase.
I get window, where I need enter my passphrase:
pinentry-qt
Please enter the passphrase to unlock the OpenPGP secret key:
I need enter my passphrase each time, as I make commit;
exclude: small-time between commits.
I find in my USERPROFILE
folder — C:\Users\SashaChernykh
— .gnupg\gpg-agent.conf
file. I try add to this file no-tty, batch or no-use-agent lines:
no-tty
batch
no-use-agent
I still get actual behavior, not expected.
default-cache-ttl
and max-cache-ttl
parameters in C:\Users\SashaChernykh\.gnupg\gpg-agent.conf
file, but it not disables passphrase entering.Enable the ssh-agent service, use ssh-add to add your key to the ssh store, and set GIT_SSH in your environment (if necessary) and git/ssh will remember your passphrase via ssh-agent.
default-cache-ttl max-cache-ttl
This is the correct way to do this. The default timeout there is 10 minutes so if there are more then 10 minutes between your commits you would have to extend the time.
C:\Users\SashaChernykh.gnupg\gpg-agent.conf
This is not the correct path. This would be the path on a GNU/Linux system.
The Home directory for GnuPG on Windows is %APPDATA%\gnupg
e.g.
c:\Users\SashaChernykh\Appdata\Roaming\gnupg\gpg-agent.conf
After changing it you also have to restart the gpg-agent process.
You can do this by using gpgconf on the command line.
gpgconf --reload gpg-agent
The simplest way to change the value with Gpg4win and check that it was really set is by using Kleopatra:
Settings -> Configure Kleopatra -> GnuPG System -> Private Keys
There you can view the settings of and change:
expire cached PINs after N seconds
set maximum PIN cache lifetime to N seconds
To some high value.
If you don't want to have ever enter a passphrase you can simply remove it from your key.
On the command line:
gpg --passwd <yourkeyid or email>
You can leave it empty and will be asked two times to confirm that you want to leave it empty. Afterwards the passphrase of you key is removed and you do not have to enter the passphrase ever again.
You can also select change passphrase from Kleopatra's Details Window (double click on the key).
Nothing to do with Git in particular, you need a gpg-agent running. Git for Windows shell has it packaged. There are some instructions here how to run the agent automatically: https://medium.com/@timmywil/sign-your-commits-on-github-with-gpg-566f07762a43
The tricky bit of running the gpg-agent - after it starts, it needs to set environment variables so that gpg could find its PID and socket.
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