When I run gpg --list-secret-keys --keyid-format LONG
within git I get no display of keys at all. On the other hand, when I run the same command in cmd
or PowerShell
I get an output that looks like
I also added the gpg.program
config in the global config file by running git config --global gpg.program "/c/Program Files (x86)/GnuPG/bin/gpg.exe"
. To no avail. Any idea what I could be doing wrong? As a side note, I am only using git bash and have not integrated git into windows.
I ended up figuring out how to use GPG4Win
in Git Bash
Check if GPG4Win is in your windows path variable
System variables
PATH
that looks like this Add gpg.program
into git config
git config --global gpg.program "C:/Program Files (x86)/GnuPG/bin/gpg.exe"
. This will make sure it is using the system-installed gpg
program.NOTE: If you are still having issues add this line to your ~/.bashrc
file and replace {Your User Directory}
with your user name.
export GNUPGHOME="/c/Users/{Your User Directory}/AppData/Roaming/gnupg"
source ~/.bashrc # Adds the env you just added to your current session
That is it you should now be able to restart git bash and view all of your keys or add keys to the Windows installed gpg
program.