问题
I'm signing my commits in Git using GnuPG. I'd prefer it greatly if Git would use /usr/bin/gpg2 rather than /usr/bin/gpg for signing commits for some compatibility reasons.
Is there a Git configuration setting which will allow me to set which GnuPG binary to use during signing? I haven't been able to find one.
回答1:
You could try and set the right config:
git config gpg.program gpg2
From git config man page:
Use this custom program instead of "
gpg" found on$PATHwhen making or verifying a PGP signature.
来源:https://stackoverflow.com/questions/38366490/change-the-binary-that-git-uses-to-invoke-gnupg-for-signing-commits