1
0
mirror of synced 2026-01-08 12:01:53 -05:00

Add ssh commit verification content (#29819)

This commit is contained in:
Chris Westra
2022-08-23 13:31:31 -04:00
committed by GitHub
parent 14a9a934df
commit b90f86e80a
20 changed files with 149 additions and 125 deletions

View File

@@ -0,0 +1,4 @@
1. Configure Git to use SSH to sign commits and tags:
```bash
$ git config --global gpg.format ssh
```

View File

@@ -0,0 +1,43 @@
1. Copy the SSH public key to your clipboard.
If your SSH public key file has a different name than the example code, modify the filename to match your current setup. When copying your key, don't add any newlines or whitespace.
{% mac %}
```shell
$ pbcopy < ~/.ssh/id_{% ifversion ghae %}rsa{% else %}ed25519{% endif %}.pub
# Copies the contents of the id_{% ifversion ghae %}rsa{% else %}ed25519{% endif %}.pub file to your clipboard
```
{% tip %}
**Tip:** If `pbcopy` isn't working, you can locate the hidden `.ssh` folder, open the file in your favorite text editor, and copy it to your clipboard.
{% endtip %}
{% endmac %}
{% windows %}
```shell
$ clip < ~/.ssh/id_{% ifversion ghae %}rsa{% else %}ed25519{% endif %}.pub
# Copies the contents of the id_{% ifversion ghae %}rsa{% else %}ed25519{% endif %}.pub file to your clipboard
```
{% tip %}
**Tip:** If `clip` isn't working, you can locate the hidden `.ssh` folder, open the file in your favorite text editor, and copy it to your clipboard.
{% endtip %}
{% endwindows %}
{% linux %}
```shell
$ cat ~/.ssh/id_{% ifversion ghae %}rsa{% else %}ed25519{% endif %}.pub
# Then select and copy the contents of the id_{% ifversion ghae %}rsa{% else %}ed25519{% endif %}.pub file
# displayed in the terminal to your clipboard
```
{% tip %}
**Tip:** Alternatively, you can locate the hidden `.ssh` folder, open the file in your favorite text editor, and copy it to your clipboard.
{% endtip %}
{% endlinux %}

View File

@@ -0,0 +1,4 @@
1. To set your SSH signing key in Git, paste the text below, substituting the contents of your clipboard for the key you'd like to use. Since the key contains spaces, you must wrap it in quotes:
```bash
$ git config --global user.signingkey 'ssh-ed25519 AAAAC3(...) user@example.com'
```

View File

@@ -0,0 +1,6 @@
{% note %}
**Note:** SSH signature verification is available in Git 2.34 or later. To update your version of Git, see the [Git](https://git-scm.com/downloads) website.
{% endnote %}

View File

@@ -1,5 +1,5 @@
### Telling Git about your X.509 key
## Telling Git about your X.509 key
You can use [smimesign](https://github.com/github/smimesign) to sign commits and tags using S/MIME instead of GPG.