The team wants a strictly linear history on `main`.
BeginnerScenarioProtection, Hooks and Policy
Answer
Situation read → No merge commits at all.
What I'd do →
- Enable "Require linear history" in the ruleset.
- In repo settings, allow only squash merge and/or rebase merge; disable merge commits.
- Developers rebase their branches before merging.
Why → Linear history is easier to bisect, revert and read.
Interview tip → Rebase-merge keeps each commit; squash-merge keeps one. Be ready to justify your pick.
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