Add ssh commit verification content (#29819)
This commit is contained in:
4
data/reusables/gpg/configure-ssh-signing.md
Normal file
4
data/reusables/gpg/configure-ssh-signing.md
Normal file
@@ -0,0 +1,4 @@
|
||||
1. Configure Git to use SSH to sign commits and tags:
|
||||
```bash
|
||||
$ git config --global gpg.format ssh
|
||||
```
|
||||
43
data/reusables/gpg/copy-ssh-public-key.md
Normal file
43
data/reusables/gpg/copy-ssh-public-key.md
Normal 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 %}
|
||||
4
data/reusables/gpg/paste-ssh-public-key.md
Normal file
4
data/reusables/gpg/paste-ssh-public-key.md
Normal 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'
|
||||
```
|
||||
6
data/reusables/gpg/ssh-git-version.md
Normal file
6
data/reusables/gpg/ssh-git-version.md
Normal 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 %}
|
||||
@@ -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.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user