After recovery, what do you change so a force-push to main cannot happen again?
AdvancedProductionRecovery and incident handling
Answer
Protect main with a ruleset that blocks non-fast-forward updates and deletions with an empty bypass list, review who had admin rights, alert on audit-log events for ref force-pushes, and write the postmortem including how detection worked.
More on Recovery and incident handling
Someone force-pushed over main and 12 commits vanished. How do you recover?IntermediateA bad migration commit was deployed. Walk through your response in the first 15 minutes.IntermediateHow do you recover a deleted repository or branch on GitHub?IntermediateHow do you find who or what pushed a specific commit to a protected branch?AdvancedCI is red on main after a merge. What is your policy?IntermediateA teammate rebased a shared branch and now everyone has duplicate commits. How do you repair it?Advanced