Updated the way git signing commands are shown (#762)

### Description

This fixes #761, more specifically the part (2) of their issue post. The issue was that it was not clear that the "." at the end of the command was meant to be excluded. Even if its clear to some, accidental copy and paste with the inclusion of "." have happened. Therefore, this PR is more of an improvement to the so called "quality of life".

**The fix**

Separating the commands in to code blocks and excluding the "." from the end.

**Other additions**

- The commands are also now described.
- A new command that allows users to check their current configuration in order to verify that things are as they intended. This commands

Source for both of these additions is:  https://janik6n.net/posts/signing-git-commits-with-ssh-key/

Reviewed-on: https://codeberg.org/Codeberg/Documentation/pulls/762
Co-authored-by: spuzkov <spuzkov@tuta.com>
Co-committed-by: spuzkov <spuzkov@tuta.com>
This commit is contained in:
spuzkov 2026-04-02 03:59:09 +02:00 committed by Gusted
parent d5dbed89c4
commit d11f27378f

View file

@ -175,11 +175,25 @@ To update your version of Git,see the [Git](https://git-scm.com/downloads) websi
{% endadmonition %}
1. Open your terminal.
2. Type `git config --global gpg.format ssh`.
3. Type `git config --global user.signingKey <PATH TO PUBLIC SSH KEY>`, substituting `<PATH TO PUBLIC SSH KEY>` with the
path to the public key you'd like to use, for example _~/.ssh/id_ed25519.pub_.
4. Type `git config --global commit.gpgSign true`.
In your terminal, run the following commands:
1. Make git use SSH to sign commits and tags:
```shell
git config --global gpg.format ssh
```
2. Set the SSH signing key to your public key:
```shell
git config --global user.signingKey '~/.ssh/<YOUR PUBLIC SSH KEY>'
```
3. Sign commits by default:
```shell
git config --global commit.gpgSign true
```
## Avoid re-typing the passphrase