Skip to content

Commit 8d6584d

Browse files
authored
Merge pull request #6497 from ddevsr/gpg-old-commit
docs: added about signing gpg to old commit
2 parents c1cd9bf + fb23aed commit 8d6584d

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

contributing/workflow.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,29 @@ 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+
### Signing GPG Old Commits
183+
184+
Almost developer forgot signing GPG with params `-S` in commiting like `git commit -S -m "Signed GPG"`, you can signing old commit to keep secure.
185+
186+
Latests commit :
187+
```console
188+
> git switch your-branch
189+
> git commit --amend --no-edit -n -S
190+
> git push --force-with-lease origin your-branch
191+
```
192+
193+
All commit (will be change date commit to today) :
194+
```console
195+
> git switch your-branch
196+
> git rebase -i --root --exec 'git commit --amend --no-edit -n -S'
197+
> git push --force-with-lease origin your-branch
198+
```
199+
200+
But developer can secure commit without `-S` in `git commit`, you can set `git config --global commit.gpgsign true` and `git config --global user.signingkey 3AC5C34371567BD2` to all local repostory local or without `--global` to one local repostory.
201+
202+
> **Note**
203+
> `3AC5C34371567BD2` is your GPG Key ID
204+
182205
### Changing a Commit Message
183206

184207
See <https://docs.github.com/en/pull-requests/committing-changes-to-your-project/creating-and-editing-commits/changing-a-commit-message>.

0 commit comments

Comments
 (0)