diff --git a/content/security/gpg-key.md b/content/security/gpg-key.md index 64f84b4..03bc70e 100644 --- a/content/security/gpg-key.md +++ b/content/security/gpg-key.md @@ -80,13 +80,24 @@ 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: +{% admonition "note" %} + +Just in case you have a similar error to the one below when signing a commit. + +```shell +error: gpg failed to sign the data +fatal: failed to write commit object +``` + +Then you need to execute the following command in order to add the `GPG_TTY` variable to your `~/bashrc` file. ```shell [ -f ~/.bashrc ] && echo -e '\nexport GPG_TTY=$(tty)' >> ~/.bashrc ``` -After that, reboot your system and you will be able to sign your commits. +After that, log out your session (there's no need to reboot) and you will be able to sign your commits. + +{% endadmonition %} --- > **Attribution**