Skip to content

docs: add branch protection rules documentation#686

Merged
grunch merged 1 commit intomainfrom
docs/add-branch-protection-rules
Mar 26, 2026
Merged

docs: add branch protection rules documentation#686
grunch merged 1 commit intomainfrom
docs/add-branch-protection-rules

Conversation

@mostronatorcoder
Copy link
Copy Markdown
Contributor

Overview

Add comprehensive Branch Protection Rules documentation to help team members understand the new workflow after enabling branch protection on main.


What's Documented

🛡️ Active Restrictions

  • ❌ Direct push to main (blocked)
  • ❌ Force push (disabled)
  • ❌ Branch deletion (disabled)

✅ Correct Workflow

Step-by-step guide:

  1. Create feature branch
  2. Push to feature branch
  3. Create Pull Request
  4. Get approval (minimum 1)
  5. Resolve all comments
  6. Merge via GitHub UI

🚨 Recovery Procedures

  • What to do if you accidentally pushed to main
  • How admins can revert in emergencies
  • When admin bypass is acceptable

❓ FAQ

  • Urgent changes
  • Self-approval
  • CI requirements
  • Common errors

Why This Document

This change was motivated by an accidental direct push to main in mostro-core that required manual reversion.

Branch protection prevents this from happening again, but we need clear documentation so everyone knows:

  • Why they can't push to main anymore
  • What the correct workflow is
  • What to do if something goes wrong

Benefits

  • Prevents accidents (direct pushes blocked at GitHub level)
  • Mandatory code review (improves quality)
  • Clean history (no force pushes)
  • Clear process (documented workflow)

File Added

  • docs/BRANCH_PROTECTION.md (English)

Next Steps

After merge, share this doc with the team so everyone knows the new workflow.

Ready for review! 📖

Add comprehensive documentation explaining the new branch protection
rules that prevent direct pushes to main.

## What's Documented

- Active restrictions (no direct push, no force push, no delete)
- Correct workflow (feature branch → PR → approval → merge)
- What to do if you accidentally pushed to main
- Emergency procedures for admins
- FAQ with common questions

## Why

Prevent accidental direct pushes to main.

## Benefits

- Prevents accidents
- Mandatory code review
- Clean git history
- Protected production branch
Copy link
Copy Markdown
Member

@grunch grunch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@grunch grunch merged commit 1edb71b into main Mar 26, 2026
7 checks passed
@grunch grunch deleted the docs/add-branch-protection-rules branch March 26, 2026 13:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant