
To use your X.509 key to sign for all repositories:. Subject: CN=Octocat,O=GitHub\, Inc.,L=San Francisco,ST=California,C=USĮmails: To set your X.509 signing key in Git, paste the text below, substituting in the certificate ID you copied earlier. Issuer: CN=DigiCert SHA2 Assured ID CA,OU=Inc,C=US From the list of X.509 keys, copy the certificate ID of the X.509 key you'd like to use. If you're not using an X.509 key that matches your committer identity, list X.509 keys for which you have both a certificate and private key using the smimesign -list-keys command. If you're using an X.509 key that matches your committer identity, you can begin signing commits and tags. $ git config -local gpg.program smimesign $ git config -global gpg.program smimesign In Git 2.18 or earlier, use the git config gpg.program command: To use S/MIME to sign for a single repository:. To use S/MIME to sign for all repositories:. In Git 2.19 or later, use the git config and git config gpg.format commands: Configure Git to use S/MIME to sign commits and tags. To update your version of Git, see the Git website. Note: S/MIME signature verification is available in Git 2.19 or later. You can use smimesign to sign commits and tags using S/MIME instead of GPG. zprofile file: $ if then echo 'export GPG_TTY=$(tty)' > ~/.zshrc \Įlse echo 'export GPG_TTY=$(tty)' > ~/.zprofile fiĪlternatively, if you use the bash shell, run this command: $ if then echo 'export GPG_TTY=$(tty)' > ~/.bash_profile \Įlse echo 'export GPG_TTY=$(tty)' > ~/.profile fi If you aren't using the GPG suite, run the following command in the zsh shell to add the GPG key to your.
In this example, the GPG key ID is 3AA5C34371567BD2: $ git config -global user.signingkey 3AA5C34371567BD2 To set your GPG signing key in Git, paste the text below, substituting in the GPG key ID you'd like to use.
In this example, the GPG key ID is 3AA5C34371567BD2: $ gpg -list-secret-keys -keyid-format=long In this case you will also need to configure Git to use gpg2 by running git config -global gpg.program gpg2.įrom the list of GPG keys, copy the long form of the GPG key ID you'd like to use. Note: Some GPG installations on Linux may require you to use gpg2 -list-keys -keyid-format LONG to view a list of your existing keys instead.