Skip to content

Commit

Permalink
replace GPG signing recommendation with SSH
Browse files Browse the repository at this point in the history
  • Loading branch information
audreyality committed Dec 26, 2024
1 parent ead6ebe commit f5d5f5e
Showing 1 changed file with 19 additions and 20 deletions.
39 changes: 19 additions & 20 deletions docs/contributing/commit-signing.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -22,33 +22,31 @@ their commits.
## Setting up commit signing

Github supports commit signing with GPG, SSH and S/MIME. If you're unsure what to use, we recommend
GPG.
SSH.

1. Install GnuPG:
1. Follow the [Github documentation][github-verification] to configure commit signing

<Tabs groupId="os">
2. Configure your preferred git tool below

<TabItem value="mac" label="macOS">

```bash
brew install gnupg
echo "export GPG_TTY=$(tty)" >> ~/.zshrc
```

Restart your open terminal for this to take effect

</TabItem>
3. Push a test commit to Github and ensure that the "Verified" badge appears next to the commit
description:

</Tabs>
![Image showing the Verified badge in Github](./commit-signing.png)

2. Follow the [Github documentation][github-verification] to configure commit signing
:::tip

3. Configure your preferred git tool below
We recommend you create a new commit signing key instead of reusing your Github authentication key,
and that you protect the key with a strong passphrase or password.

4. Push a test commit to Github and ensure that the "Verified" badge appears next to the commit
description:
```bash
[email protected]
ssh-keygen -f ~/.ssh/bw-signing -C "$EMAIL" -t ed25519
git.config --global user.email "$EMAIL"
git config --global gpg.format=ssh
git config --global user.signingkey=~/.ssh/bw-signing.pub
```

![Image showing the Verified badge in Github](./commit-signing.png)
(Remove the `--global` flags to only apply this setting to the current repository) :::

### Command Line

Expand All @@ -58,10 +56,11 @@ GPG.
git commit -S
```

- To avoid using the `-S` flag every time, you can sign all commits by default:
- To avoid using the `-S` flag every time, you can sign all commits and tags by default:

```bash
git config --global commit.gpgSign true
git config --global tag.gpgSign true
```

(Remove the `--global` flag to only apply this setting to the current repository)
Expand Down

0 comments on commit f5d5f5e

Please sign in to comment.