Skip to content

Commit a7b9a97

Browse files
authored
Merge pull request #497 from mattborja/readme-gpgsign
Update instructions for commit signing
2 parents b822d41 + 0c30e14 commit a7b9a97

File tree

1 file changed

+20
-3
lines changed

1 file changed

+20
-3
lines changed

README.md

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1663,15 +1663,32 @@ The path must be set according to `gpgconf --list-dirs agent-ssh-socket` on *rem
16631663
16641664
YubiKey can be used to sign commits and tags, and authenticate SSH to GitHub when configured in [Settings](https://github.com/settings/keys).
16651665
1666-
Configure a signing key:
1666+
Configure the signing key:
16671667
16681668
```console
16691669
git config --global user.signingkey $KEYID
16701670
```
16711671
1672-
Configure the `user.email` option to match the email address associated with the PGP identity.
1672+
Alternatively, if you are using the aforementioned `IdentityFile` (SSH key) for signing:
16731673
1674-
To sign commits or tags, use the `-S` option.
1674+
```console
1675+
git config --global gpg.format ssh
1676+
git config --global user.signingkey ~/.ssh/id_rsa_yubikey.pub
1677+
```
1678+
1679+
Configure the `user.name` and `user.email` option to match the email address associated with the PGP identity:
1680+
1681+
```console
1682+
git config --global user.name 'YubiKey User'
1683+
git config --global user.email yubikey@example
1684+
```
1685+
1686+
To sign commits or tags, use the `-S` option, or consider enabling commit and tag signing by default:
1687+
1688+
```console
1689+
git config --global commit.gpgsign true
1690+
git config --global tag.gpgSign true
1691+
```
16751692
16761693
**Windows**
16771694

0 commit comments

Comments
 (0)