BM: Baca dalam Bahasa Melayu
World 8: Shields: Security
Signed commits
You will learn: how to prove a commit is really yours, with a Verified badge.
The problem
Git trusts any name you type. Anyone can make commits that say “Siti”. So how can people trust a commit is really yours?
Watch
A signed commit: A commit with your digital signature, made with your private key. carries your digital signature. Only your private key can make it. GitHub checks it with your public key, like a key in its lock.
Watch
Signature checks out? GitHub shows a Verified badge: A label GitHub shows when a commit's signature checks out. badge next to the commit. Signed, but GitHub can’t check it? It says Unverified. Not signed? No badge at all.
Try it
Git can sign with an SSH key, like your key from World 4. Build the setting that picks SSH.
Tap the pieces in the right order.
Try it
Now set up signing here. You need three settings: the format, your key, and “sign every commit”.
Hint
Pointuser.signingkey at your public key, the file that ends in .pub.Predict
You push a signed commit. But your public key is not on GitHub as a signing key. What does GitHub show?
Pick one answer.
Check
Which badge does each commit get? Sort them.
Drag a card into a box. Or tap the card, then tap the box.
You did it!
You can now sign your commits and read the Verified badge.
Go deeper (optional)
GPG keys work too. That’s the default format, openpgp. SSH signing needs Git 2.34 or newer. Turn on vigilant mode, and your unsigned commits show as Unverified. git log --show-signature shows signatures on your computer. For SSH, Git first needs gpg.ssh.allowedSignersFile.
Bahasa Melayu
Git percaya apa saja nama yang anda taip. Sesiapa pun boleh buat commit yang tulis “Siti”. Jadi macam mana orang nak percaya commit itu betul-betul anda punya?
Commit bertandatangan (signed commit) bawa tandatangan digital anda. Hanya kunci peribadi anda boleh buat tandatangan itu. GitHub semak dengan kunci awam anda, macam padankan kunci dengan mangganya.
Tandatangan sah? GitHub tunjuk lencana Verified di sebelah commit itu. Bertandatangan, tapi GitHub tak dapat semak? Ia tulis Unverified. Tak bertandatangan? Tiada lencana langsung.
Git boleh tandatangan dengan kunci SSH, macam kunci anda dari Dunia 4. Bina tetapan yang pilih SSH.
Sekarang sediakan tandatangan di sini. Anda perlu tiga tetapan: format, kunci anda, dan “tandatangan setiap commit”.
user.signingkey kepada kunci awam anda, fail yang berakhir dengan .pub.Anda push commit bertandatangan. Tapi kunci awam anda tiada di GitHub sebagai signing key. Apa yang GitHub tunjuk?
Lencana apa yang setiap commit dapat? Susun semuanya.
Kini anda boleh tandatangan commit anda dan baca lencana Verified.
You finished this before. Practice is always welcome!
Official docs: git config (gpg.format, user.signingKey, commit.gpgSign) · About commit signature verification · Telling Git about your signing key
You've learned for 25 minutes. A short break helps your brain.
Sprint done! Great focus. Stretch for a minute?