Improve SSH commit signing instructions (#2265)

Signed-off-by: Jonah Aragon <jonah@triplebit.net>
This commit is contained in:
nopeitsnothing 2023-10-13 23:28:20 -04:00 committed by GitHub
parent b0b6434f28
commit b3a26717cd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -13,14 +13,9 @@ You can use an existing SSH key for signing, or [create a new one](https://docs.
git config --global gpg.format ssh
git config --global tag.gpgSign true
```
2. Copy your SSH public key to your clipboard, for example:
2. Set your SSH key for signing in Git with the following command, substituting `/PATH/TO/.SSH/KEY.PUB` with the path to the public key you'd like to use, e.g. `/home/user/.ssh/id_ed25519.pub`:
```
pbcopy < ~/.ssh/id_ed25519.pub
# Copies the contents of the id_ed25519.pub file to your clipboard
```
3. Set your SSH key for signing in Git with the following command, replacing the last string in quotes with the public key in your clipboard:
```
git config --global user.signingkey 'ssh-ed25519 AAAAC3(...) user@example.com'
git config --global user.signingkey /PATH/TO/.SSH/KEY.PUB
```
Ensure you [add your SSH key to your GitHub account](https://docs.github.com/en/authentication/connecting-to-github-with-ssh/adding-a-new-ssh-key-to-your-github-account#adding-a-new-ssh-key-to-your-account) **as a Signing Key** (as opposed to or in addition to as an Authentication Key).