You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/github/authenticating-to-github/telling-git-about-your-signing-key.md
+11-11Lines changed: 11 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -31,16 +31,16 @@ If you have multiple GPG keys, you need to tell Git which one to use.
31
31
{% data reusables.gpg.list-keys-with-note %}
32
32
{% data reusables.gpg.copy-gpg-key-id %}
33
33
{% data reusables.gpg.paste-gpg-key-id %}
34
-
1. If you aren't using the GPG suite, paste the text below to add the GPG key to your bash profile:
34
+
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:
35
35
```shell
36
-
$ test -r ~/.bash_profile &&echo'export GPG_TTY=$(tty)'>>~/.bash_profile
37
-
$ echo'export GPG_TTY=$(tty)'>>~/.profile
36
+
$ if [ -r~/.zshrc ];thenecho'export GPG_TTY=$(tty)'>>~/.zshrc; \
37
+
elseecho'export GPG_TTY=$(tty)'>>~/.zprofile;fi
38
+
```
39
+
Alternatively, if you use the `bash` shell, run this command:
40
+
```shell
41
+
$ if [ -r~/.bash_profile ];thenecho'export GPG_TTY=$(tty)'>>~/.bash_profile; \
42
+
elseecho'export GPG_TTY=$(tty)'>>~/.profile;fi
38
43
```
39
-
{% note %}
40
-
41
-
**Note:** If you don't have `.bash_profile`, this command adds your GPG key to `.profile`.
42
-
43
-
{% endnote %}
44
44
45
45
{% data reusables.gpg.x-509-key %}
46
46
@@ -93,10 +93,10 @@ If you have multiple GPG keys, you need to tell Git which one to use.
93
93
{% data reusables.gpg.list-keys-with-note %}
94
94
{% data reusables.gpg.copy-gpg-key-id %}
95
95
{% data reusables.gpg.paste-gpg-key-id %}
96
-
1. To add your GPG key to your bash profile, paste the text below:
96
+
1. To add your GPG key to your bash profile, run the following command:
0 commit comments