Skip to content

Commit 9482b49

Browse files
committed
docs: add "Set Default Signing" section and refer it
1 parent d72a893 commit 9482b49

2 files changed

Lines changed: 19 additions & 5 deletions

File tree

contributing/signing.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -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)