Search code examples
gitgnupg

Change the binary that Git uses to invoke GnuPG for signing commits?


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.


Solution

  • 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 $PATH when making or verifying a PGP signature.