Skip to content

Commit aaef1de

Browse files
authored
Merge pull request #8475 from kenjis/docs-contrib-signing
docs: improve contributing/signing.md
2 parents 8fc9503 + 7755703 commit aaef1de

2 files changed

Lines changed: 20 additions & 6 deletions

File tree

contributing/signing.md

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ Read below to find out how to sign your commits :)
2929

3030
## Secure Signing
3131

32-
To verify your commits, you will need to setup a GPG key, and attach it
32+
To verify your commits, you will need to set up a GPG key, and attach it
3333
to your GitHub account.
3434

3535
See the [git tools](https://git-scm.com/book/en/v2/Git-Tools-Signing-Your-Work) page
@@ -47,7 +47,19 @@ The basic steps are
4747
- Provide your GPG key passphrase, as prompted, when you do a commit.
4848

4949
Depending on your IDE, you may have to do your Git commits from your Git
50-
bash shell to use the **-S** option to force the secure signing.
50+
bash shell to use the `-S` option to force the secure signing.
51+
52+
## Set Default Signing
53+
54+
We recommend you set git securely sign commits without the `-S` option in
55+
`git commit`.
56+
57+
You can do it by setting `git config --global commit.gpgsign true` and
58+
`git config --global user.signingkey 3AC5C34371567BD2` to all local repositories.
59+
Without the `--global` option, the change is applied to one local repository only.
60+
61+
> [!NOTE]
62+
> `3AC5C34371567BD2` is your GPG Key ID
5163
5264
## Commit Messages
5365

contributing/workflow.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,10 @@ For instance, to commit your work from a debugging session:
179179

180180
Just make sure that your commits in a feature branch are all related.
181181

182+
> [!NOTE]
183+
> We recommend to [Set Default Signing](./signing.md#set-default-signing) for
184+
> secure signing commits without the `-S` option in `git commit`.
185+
182186
### GPG-Signing Old Commits
183187

184188
Any developer can forget GPG-signing their commits with the option `-S`, like `git commit -S -m 'Signed GPG'`. In such a case, all you need to do is the following:
@@ -197,10 +201,8 @@ All commits:
197201
> git push --force-with-lease origin your-branch
198202
```
199203

200-
As a faster alternative, you can still securely sign commits without the `-S` option in `git commit` by setting `git config --global commit.gpgsign true` and `git config --global user.signingkey 3AC5C34371567BD2` to all local repositories. Without the `--global` option, the change is applied to one local repository only.
201-
202-
> **Note**
203-
> `3AC5C34371567BD2` is your GPG Key ID
204+
As a faster alternative, you can still securely sign commits without the `-S`
205+
option in `git commit`. See [Set Default Signing](./signing.md#set-default-signing).
204206

205207
### Changing a Commit Message
206208

0 commit comments

Comments
 (0)