| <- Previous: Set Up SSH | Next: Make Your First Commit -> |
|---|
Configure Git to sign commits with SSH and understand what GitHub checks before showing the Verified badge.
- explain the difference between authentication and signing
- configure Git for SSH commit signing
- explain what GitHub verifies when it marks a commit as
Verified
- Authentication proves your machine can connect to GitHub.
- Signing proves a commit contains a cryptographic signature from a registered signing key.
- A signed commit is not the same thing as a pushed commit. You can push unsigned commits, and you can sign commits before pushing them.
GitHub can mark a commit as Verified when:
- the commit contains a valid cryptographic signature
- the signature matches a public signing key registered to the account
- the commit metadata is consistent enough for GitHub to attribute the signature correctly
You can reuse the same SSH public key you created in the previous module.
- print the public key:
cat ~/.ssh/id_ed25519.pub- open GitHub -> Settings -> SSH and GPG keys
- click New SSH key
- select Signing Key
- paste the public key and save
Run:
git config --global gpg.format ssh
git config --global user.signingkey ~/.ssh/id_ed25519.pub
git config --global commit.gpgsign trueRun:
git config --global --get gpg.format
git config --global --get user.signingkey
git config --global --get commit.gpgsignThen run the full setup check from the root of your template copy:
bash scripts/run-full-check.shOn Windows PowerShell, run:
powershell -ExecutionPolicy Bypass -File scripts/run-full-check.ps1On Windows Command Prompt, run:
scripts\run-full-check.cmdAfter you push a signed commit to GitHub, inspect the latest commit in the GitHub UI and confirm that it shows Verified.
The script prints PASS, WARN, and FAIL directly in the terminal. At this stage, signing checks are required and should pass.
gpg.formatis set tossh.user.signingkeypoints to your public SSH key.commit.gpgsignis set totrue.- You can explain that authentication controls access to GitHub, while signing proves commit authorship.
| <- Previous: Set Up SSH | Next: Make Your First Commit -> |
|---|