Why sign commits and what are the options?
BeginnerConceptHooks, submodules, LFS and signing
Answer
Author name and email are just text and can be forged, so signatures prove who made a commit. Options are GPG, SSH keys (Git 2.34+) and Sigstore gitsign (keyless). GitHub shows a Verified badge when the signature matches a key on the account.
git config --global gpg.format ssh
git config --global user.signingkey ~/.ssh/id_ed25519.pub
git config --global commit.gpgsign true
More on Hooks, submodules, LFS and signing
What are Git hooks and where do they live?BeginnerHow do you share hooks with a team, given `.git/hooks` is not committed?IntermediateWhat does the `commit-msg` hook receive and what is it good for?IntermediateWhat do `pre-receive` and `update` hooks do and how do they differ?AdvancedWhat is a Git submodule?BeginnerWhy do submodules confuse people and what are the common pitfalls?Intermediate