-
-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'fixing-typo' of https://github.com/whyevenquestion1t/do…
…cs-1 into fixing-typo
- Loading branch information
Showing
4 changed files
with
70 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
content/docs/reference/best-practices/github-sign-your-commits-with-ssh.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
--- | ||
title: "Sign Your GitHub Commits with SSH" | ||
--- | ||
|
||
If you are already using SSH to authenticate to GitHub, it is very easy to sign all your commits as well, as long as you have already installed Git 2.34.0 or later. (Note, there may be problems with OpenSSH 8.7. Use an earlier or later version. I have this working with OpenSSH 8.1p1.) | ||
|
||
### Configure git to sign all your commits with an SSH key | ||
|
||
```bash | ||
git config --global gpg.format ssh | ||
git config --global commit.gpgsign true | ||
git config --global tag.gpgsign true | ||
``` | ||
|
||
### Configure git with the public key to use when signing | ||
|
||
Set `KEY_FILE` to the file containing your SSH public key | ||
|
||
```bash | ||
KEY_FILE=~/.ssh/id_ed25519.pub | ||
git config --global user.signingKey "$(head -1 $KEY_FILE)" | ||
``` | ||
|
||
Add your SSH public key to GitHub as a signing key, much the same way you added it as an authentication key, but choose "Signing Key" instead of "Authentication Key" under "Key type", even if you already have it uploaded as an authentication key. Detailed instructions are available [here](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). | ||
|
||
We suggest using the same key you use to authenticate with, so that signing is the same as pulling and pushing, but you can use a different key if you want to be prompted for a password with every commit. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters