title: How do I install and use gpg-agent on Windows?
body: <p>I'm trying to start signing Git commits. I setup a GPG key with keybase.io and have it synced on my local machine and on my Git server. Now, I'm trying to solve the problem of typing the key passphrase on <em>every single commit</em>.</p>
  
  <pre><code>PS&gt; git commit -m "testing" --allow-empty
  
  You need a passphrase to unlock the secret key for
  user: "keybase.io/anthonymastrean &lt;anthonymastrean@keybase.io&gt;"
  2048-bit RSA key, ID AD9184C0, created 2015-04-14 (main key ID 293FEB8B)
  
  Enter passphrase:
  </code></pre>
  
  <p>As I understand it, I need something like gpg-agent installed. I'm on Windows 10 Pro 1803, so I'm looking at <a href="https://www.gpg4win.org/" rel="noreferrer">Gpg4win</a> (recommend by GitHub and others). I installed it via <a href="https://chocolatey.org/packages/Gpg4win" rel="noreferrer">Chocolatey</a>, so I have the complete default installation.</p>
  
  <p>However, I can't figure out how to get gpg-agent to start caching my passphrase. I'm prompted every time I commit.</p>
  
  <p>The gpg-agent says it's running </p>
  
  <pre><code>PS&gt; gpg-agent
  gpg-agent[4644]: gpg-agent running and available
  </code></pre>
  
  <p>I've this gpg-connect-agent thing, but I don't know what to do with it.</p>
  
  <pre><code>PS&gt; gpg-connect-agent.exe
  &gt; help
  # NOP
  # CANCEL
  # OPTION
  # BYE
  # AUTH
  # RESET
  # END
  # HELP
  # GETEVENTCOUNTER
  # ISTRUSTED &lt;hexstring_with_fingerprint&gt;
  # HAVEKEY &lt;hexstrings_with_keygrips&gt;
  # KEYINFO [--[ssh-]list] [--data] [--ssh-fpr] [--with-ssh] &lt;keygrip&gt;
  # SIGKEY &lt;hexstring_with_keygrip&gt;
  # SETKEY
  # SETKEYDESC plus_percent_escaped_string
  # SETHASH (--hash=&lt;name&gt;)|(&lt;algonumber&gt;) &lt;hexstring&gt;
  # PKSIGN [&lt;options&gt;] [&lt;cache_nonce&gt;]
  # PKDECRYPT [&lt;options&gt;]
  # GENKEY [--no-protection] [--preset] [--inq-passwd]
  # READKEY &lt;hexstring_with_keygrip&gt;
  # GET_PASSPHRASE [--data] [--check] [--no-ask] [--repeat[=N]]
  # PRESET_PASSPHRASE [--inquire] &lt;string_or_keygrip&gt; &lt;timeout&gt; [&lt;hexstring&gt;]
  # CLEAR_PASSPHRASE [--mode=normal] &lt;cache_id&gt;
  # GET_CONFIRMATION &lt;description&gt;
  # LISTTRUSTED
  # MARKTRUSTED &lt;hexstring_with_fingerprint&gt; &lt;flag&gt; &lt;display_name&gt;
  # LEARN [--send] [--sendinfo] [--force]
  # PASSWD [--cache-nonce=&lt;c&gt;] [--passwd-nonce=&lt;s&gt;] [--preset]
  # INPUT
  # OUTPUT
  # SCD &lt;commands to pass to the scdaemon&gt;
  # KEYWRAP_KEY [--clear] &lt;mode&gt;
  # IMPORT_KEY [--unattended] [--force] [&lt;cache_nonce&gt;]
  # EXPORT_KEY [--cache-nonce=&lt;nonce&gt;] [--openpgp] &lt;hexstring_with_keygrip&gt;
  # DELETE_KEY [--force|--stub-only] &lt;hexstring_with_keygrip&gt;
  # GETVAL &lt;key&gt;
  # PUTVAL &lt;key&gt; [&lt;percent_escaped_value&gt;]
  # UPDATESTARTUPTTY
  # KILLAGENT
  # RELOADAGENT
  # GETINFO &lt;what&gt;
  # KEYTOCARD [--force] &lt;hexstring_with_keygrip&gt; &lt;serialno&gt; &lt;id&gt; &lt;timestamp&gt;
  OK
  </code></pre>
  
  <hr>
  
  <p>I see the man page talks about how to start the gpg-agent in a Bash session, but I'm not sure how to translate that to Windows and have it work across cmd.exe and PowerShell.</p>
  
  <p><a href="https://linux.die.net/man/1/gpg-agent" rel="noreferrer">https://linux.die.net/man/1/gpg-agent</a></p>