Auditors want every commit on `main` to be verified as signed.
IntermediateScenarioProtection, Hooks and Policy
Answer
Situation read → Enforcement and developer setup both matter.
What I'd do →
- Enable "Require signed commits" in the ruleset for
main. - Give developers a signing setup, for example SSH signing:
git config --global gpg.format ssh
git config --global user.signingkey ~/.ssh/id_ed25519.pub
git config --global commit.gpgsign true
- Upload the same key to GitHub as a "Signing key".
- With squash or web merges, GitHub signs the resulting commit itself.
Why → Branch rules reject unsigned pushes, so signing is not optional.
Interview tip → Mention that rebase-merge breaks signatures because the commits are re-created.
More on Protection, Hooks and Policy
You are asked to protect `main`. Which rules do you turn on?BeginnerClassic branch protection or repository rulesets: which do you use?IntermediateA required status check never reports and the PR is stuck as "Expected — Waiting for status".IntermediateProduction is down and the fix needs to merge now, but approvals are required.IntermediateYou want to stop developers from committing obvious mistakes like debug prints, trailing whitespace or secrets.BeginnerHooks in `.git/hooks` are not shared with the team. How do you distribute them?Intermediate