Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: added about signing gpg to old commit #6497

Merged
merged 2 commits into from
Sep 6, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions contributing/workflow.md
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,29 @@ For instance, to commit your work from a debugging session:

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

### Signing GPG Old Commits

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.

Latests commit :
```console
> git switch your-branch
> git commit --amend --no-edit -n -S
> git push --force-with-lease origin your-branch
```
kenjis marked this conversation as resolved.
Show resolved Hide resolved

All commit (will be change date commit to today) :
```console
> git switch your-branch
> git rebase -i --root --exec 'git commit --amend --no-edit -n -S'
> git push --force-with-lease origin your-branch
```

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.

> **Note**
> `3AC5C34371567BD2` is your GPG Key ID

### Changing a Commit Message

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