Skip to content

Commit fd060f0

Browse files
Update CONTRIBUTING.md with steps to sign commits with ssh key (#266)
Signed-off-by: Keval Morabia <[email protected]>
1 parent 5f190eb commit fd060f0

File tree

2 files changed

+22
-6
lines changed

2 files changed

+22
-6
lines changed

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
## Before your PR is "*Ready for review*"
1919
<!-- If you haven't finished some of the above items you can still open `Draft` PR. -->
2020

21-
- **Make sure you read and follow [Contributor guidelines](https://github.com/NVIDIA/TensorRT-Model-Optimizer/blob/main/CONTRIBUTING.md)**
21+
- **Make sure you read and follow [Contributor guidelines](https://github.com/NVIDIA/TensorRT-Model-Optimizer/blob/main/CONTRIBUTING.md)** and your commits are signed.
2222
- **Is this change backward compatible?**: Yes/No <!--- If No, explain why. -->
2323
- **Did you write any new necessary tests?**: Yes/No
2424
- **Did you add or update any necessary documentation?**: Yes/No

CONTRIBUTING.md

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -75,24 +75,40 @@ git push origin <branch> --force-with-lease
7575
- We require that all contributors "sign-off" on their commits. This certifies that the contribution is your original
7676
work, or you have rights to submit it under the same license, or a compatible license.
7777

78-
- You need to sign-off your commits using an GPG / SSH key which is different than the one used for authentication. See [GitHub docs](https://docs.github.com/en/authentication/managing-commit-signature-verification/signing-commits) for more details.
78+
- You need to cryptographically sign-off your commits as well using an SSH/GPG key which is different than the one used for authentication. See [GitHub docs](https://docs.github.com/en/authentication/managing-commit-signature-verification/signing-commits) for more details. Note that setting up the SSH key is much simpler than the GPG key hence recommended to use SSH signing key following the steps below (requires `git>=2.34`).
7979

80-
- Any contribution which contains commits that are not Signed-Off will not be accepted.
80+
- Generate a new SSH key as per steps [in this doc](https://docs.github.com/en/authentication/connecting-to-github-with-ssh/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent#generating-a-new-ssh-key). For example:
8181

82-
- To sign off on a commit you simply use the `--signoff --gpg-sign` (or `-s -S`) option when committing your changes:
82+
```bash
83+
ssh-keygen -t ed25519 -f "${HOME}/.ssh/id_ed25519_git_signing" -P ""
84+
```
85+
86+
- Upload the public key (`cat "${HOME}/.ssh/id_ed25519_git_signing.pub"`) as a new SSH key in your [GitHub settings](https://github.com/settings/ssh/new) with an appropriate title and select key type as `Signing Key`.
87+
88+
- Configure your local `git` to use the new SSH key for signing commits:
89+
90+
```bash
91+
git config --global user.signingkey "${HOME}/.ssh/id_ed25519_git_signing.pub"
92+
git config --global gpg.format ssh
93+
git config --global commit.gpgsign true
94+
```
95+
96+
- **Any contribution which contains commits that are not Signed-Off will not be accepted**.
97+
98+
- Once you have set up your SSH/GPG key, to sign off on a commit you simply use the `--signoff --gpg-sign` (or `-s -S`) option when committing your changes:
8399

84100
```bash
85101
git commit -s -S -m "Add cool feature."
86102
```
87103

104+
> *TIP: To enable this for committing in VSCode, you can enable `git.alwaysSignOff` and `git.enableCommitSigning` in your VSCode settings (`Ctrl/Cmd + ,`).*
105+
88106
This will append the following to your commit message:
89107

90108
```
91109
Signed-off-by: Your Name <[email protected]>
92110
```
93111

94-
To enable this for committing in VSCode, you can enable `git.alwaysSignOff` and `git.enableCommitSigning` in your VSCode settings.
95-
96112
- Full text of the Developer Certificate of Origin (DCO):
97113

98114
```

0 commit comments

Comments
 (0)