From b7f25f1431f237393978444c11f6cfad59e2de31 Mon Sep 17 00:00:00 2001 From: jmarsal Date: Tue, 23 Jan 2024 19:32:22 +0100 Subject: [PATCH] feat: add shell command to add your GPG key to .bashrc, otherwise the signing process will not work --- content/security/gpg-key.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/content/security/gpg-key.md b/content/security/gpg-key.md index 50d8376..64f84b4 100644 --- a/content/security/gpg-key.md +++ b/content/security/gpg-key.md @@ -80,6 +80,14 @@ You will need to tell Git about your key and have it sign new commits for you. 2. Type `git config --global user.signingkey ` 3. Type `git config --global commit.gpgsign true` +Finally, to add your GPG key to your .bashrc startup file, run the following command: + +```shell +[ -f ~/.bashrc ] && echo -e '\nexport GPG_TTY=$(tty)' >> ~/.bashrc +``` + +After that, reboot your system and you will be able to sign your commits. + --- > **Attribution** > This guide is derived from [GitHub Docs](https://docs.github.com), used under CC-BY 4.0.