Skip to content

Commit 95e4aa2

Browse files
authored
Clarify email and handle placeholders in commit signing guide
Updated email and handle placeholders in GPG signing instructions for clarity.
1 parent ab0d3b6 commit 95e4aa2

File tree

1 file changed

+26
-18
lines changed

1 file changed

+26
-18
lines changed

practices/guides/commit-signing.md

Lines changed: 26 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -43,25 +43,29 @@
4343
> If you go for the private email option, consider enabling `Block command line pushes that expose my email`.
4444

4545
1. Avoid adding a comment (this *may* prevent git from auto-selecting a key - see Troubleshooting section below)
46+
1. Review your inputs and press enter `O` to confirm
4647
1. Define a passphrase for the key
4748

4849
1. Test the key is visible and export the PGP PUBLIC KEY (to your clipboard):
4950

5051
```bash
5152
gpg -k # This should list the new key
52-
gpg --armor --export ${my_email_address} | pbcopy
53+
gpg --armor --export <my_email_address> | pbcopy
5354
```
5455

56+
> [!NOTE]
57+
> Your PGP PUBLIC KEY is now in your clipboard!
58+
5559
1. [Add the public key to your GitHub account](https://github.com/settings/gpg/new) (`Settings` -> `SSH and GPG keys` -> `New GPG key`)
5660

5761
> Note the `Key ID` as you'll need this in the next step.
5862
5963
1. Set your local git config to use GPG signing:
6064
6165
```bash
62-
git config --global user.email ${my_email_address} # same one used during key generation
63-
git config --global user.name ${github_handle}
64-
git config --global user.signingkey ${key_id}
66+
git config --global user.email <my_email_address> # same one used during key generation
67+
git config --global user.name <github_handle>
68+
git config --global user.signingkey <key_id>
6569
git config --global commit.gpgsign true
6670
git config --global tag.gpgsign true
6771
```
@@ -72,7 +76,7 @@
7276

7377
### Windows
7478

75-
1. Install [Git for Windows](https://git-scm.com/download/win) (which includes Bash and GnuPG)
79+
1. Install (as administrator) [Git for Windows](https://git-scm.com/download/win) (which includes Bash and GnuPG)
7680
1. Open `Git Bash`
7781
1. Create a new GPG key:
7882

@@ -89,25 +93,29 @@
8993
> If you go for the private email option, consider enabling `Block command line pushes that expose my email`.
9094

9195
1. Avoid adding a comment (this *may* prevent git from auto-selecting a key - see Troubleshooting section below)
92-
1. Define a passphrase for the key
96+
1. Review your inputs and press enter `O` to confirm
97+
1. A new window called pinentry will appear prompting you to enter a passphrase.
9398

9499
1. Test the key is visible and export the PGP PUBLIC KEY (to your clipboard):
95100

96101
```bash
97102
gpg -k # This should list the new key
98-
gpg --armor --export ${my_email_address} | clip
103+
gpg --armor --export <my_email_address> | clip
99104
```
100105

106+
> [!NOTE]
107+
> Your PGP PUBLIC KEY is now in your clipboard!
108+
101109
1. [Add the public key to your GitHub account](https://github.com/settings/gpg/new) (`Settings` -> `SSH and GPG keys` -> `New GPG key`)
102110

103111
> Note the `Key ID` as you'll need this in the next step.
104112
105113
1. Set your local git config to use GPG signing:
106114
107115
```bash
108-
git config --global user.email ${my_email_address} # same one used during key generation
109-
git config --global user.name ${github_handle}
110-
git config --global user.signingkey ${key_id}
116+
git config --global user.email <my_email_address> # same one used during key generation
117+
git config --global user.name <github_handle>
118+
git config --global user.signingkey <key_id>
111119
git config --global commit.gpgsign true
112120
git config --global tag.gpgsign true
113121
```
@@ -117,10 +125,10 @@
117125
1. Export the key:
118126
119127
```bash
120-
gpg --output <GitHub handle>.pgp --export-secret-key ${my_email_address}$
128+
gpg --output <GitHub handle>.pgp --export-secret-key <my_email_address>
121129
```
122130
123-
1. Install [Gpg4win](https://www.gpg4win.org/) (which includes GnuPG and Kleopatra)
131+
1. Install (as administrator) [Gpg4win](https://www.gpg4win.org/) (which includes GnuPG and Kleopatra)
124132
125133
> **Ensure both `GnuPG` and `Kleopatra` are installed!**
126134
@@ -129,9 +137,9 @@
129137
130138
```bash
131139
gpg -k # This should list the new key
132-
git config --global user.email ${my_email_address} # same one used during key generation
133-
git config --global user.name ${github_handle}
134-
git config --global user.signingkey ${key_id}
140+
git config --global user.email <my_email_address> # same one used during key generation
141+
git config --global user.name <github_handle>
142+
git config --global user.signingkey <key_id>
135143
git config --global commit.gpgsign true
136144
git config --global tag.gpgsign true
137145
```
@@ -151,9 +159,9 @@
151159
152160
```bash
153161
gpg -k # This should list the new key
154-
git config --global user.email ${my_email_address} # same one used during key generation
155-
git config --global user.name ${github_handle}
156-
git config --global user.signingkey ${key_id}
162+
git config --global user.email <my_email_address> # same one used during key generation
163+
git config --global user.name <github_handle>
164+
git config --global user.signingkey <key_id>
157165
git config --global commit.gpgsign true
158166
git config --global tag.gpgsign true
159167
```

0 commit comments

Comments
 (0)