Interview Prep/Git & GitHub/Secrets, Signing and Security

You must set up signed commits on your laptop. Which method do you pick?

BeginnerScenarioSecrets, Signing and Security
Answer

Situation read → GPG works but is heavier; SSH signing is simpler if you already use SSH.

What I'd do →

  1. git config --global gpg.format ssh.
  2. git config --global user.signingkey ~/.ssh/id_ed25519.pub.
  3. git config --global commit.gpgsign true and tag.gpgsign true.
  4. Add the public key to GitHub as a Signing key, separate from the authentication key.
  5. Test: git commit --allow-empty -m "test" && git log --show-signature -1.

Why → SSH signing needs no extra tooling and works with hardware keys.

Interview tip → Local verification needs gpg.ssh.allowedSignersFile; GitHub verifies server-side.

All Git & GitHub questions Roadmap: Git & GitHub

More on Secrets, Signing and Security