diff --git a/content/authentication/managing-commit-signature-verification/telling-git-about-your-signing-key.md b/content/authentication/managing-commit-signature-verification/telling-git-about-your-signing-key.md index ad915796f369..c652a144af28 100644 --- a/content/authentication/managing-commit-signature-verification/telling-git-about-your-signing-key.md +++ b/content/authentication/managing-commit-signature-verification/telling-git-about-your-signing-key.md @@ -39,13 +39,13 @@ If you have multiple GPG keys, you need to tell Git which one to use. {% data reusables.gpg.set-auto-sign %} 1. If you aren't using the GPG suite, run the following command in the `zsh` shell to add the GPG key to your `.zshrc` file, if it exists, or your `.zprofile` file: ```shell - $ if [ -r ~/.zshrc ]; then echo 'export GPG_TTY=$(tty)' >> ~/.zshrc; \ - else echo 'export GPG_TTY=$(tty)' >> ~/.zprofile; fi + $ if [ -r ~/.zshrc ]; then echo -e '\nexport GPG_TTY=\$(tty)' >> ~/.zshrc; \ + else echo -e '\nexport GPG_TTY=\$(tty)' >> ~/.zprofile; fi ``` Alternatively, if you use the `bash` shell, run this command: ```shell - $ if [ -r ~/.bash_profile ]; then echo 'export GPG_TTY=$(tty)' >> ~/.bash_profile; \ - else echo 'export GPG_TTY=$(tty)' >> ~/.profile; fi + $ if [ -r ~/.bash_profile ]; then echo -e '\nexport GPG_TTY=\$(tty)' >> ~/.bash_profile; \ + else echo -e '\nexport GPG_TTY=\$(tty)' >> ~/.profile; fi ``` 1. Optionally, to prompt you to enter a PIN or passphrase when required, install `pinentry-mac`. For example, using [Homebrew](https://brew.sh/): ```shell @@ -97,7 +97,7 @@ If you have multiple GPG keys, you need to tell Git which one to use. {% data reusables.gpg.set-auto-sign %} 1. To add your GPG key to your `.bashrc` startup file, run the following command: ```bash - $ [ -f ~/.bashrc ] && echo 'export GPG_TTY=$(tty)' >> ~/.bashrc + $ [ -f ~/.bashrc ] && echo -e '\nexport GPG_TTY=\$(tty)' >> ~/.bashrc ``` {% endlinux %} {% ifversion ssh-commit-verification %}