From d11f27378f7212575b3b9243ad7cf056777eab84 Mon Sep 17 00:00:00 2001 From: spuzkov Date: Thu, 2 Apr 2026 03:59:09 +0200 Subject: [PATCH] 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 Co-committed-by: spuzkov --- content/security/ssh-key.md | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/content/security/ssh-key.md b/content/security/ssh-key.md index 6536ee6..20dd28c 100644 --- a/content/security/ssh-key.md +++ b/content/security/ssh-key.md @@ -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 `, substituting `` 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/' +``` + +3. Sign commits by default: + +```shell +git config --global commit.gpgSign true +``` ## Avoid re-typing the passphrase