This guide explains exactly which checkboxes to enable when setting up branch protection for your GitHub repository, based on your screenshot.
- ☑️ Enable this checkbox
- Why: Prevents accidentally uploading huge files that can break your repository
- Impact: Low - only blocks genuinely large files
- ☑️ Enable this checkbox
- Why: Prevents accidental destruction of commit history
- Impact: Medium - you can still force push from Settings if needed
- ☑️ Enable this checkbox
- Why: Forces you to review changes before they go to main branch
- Impact: Medium - you'll need to create PRs for changes
- Sub-options to enable:
- ☑️ Dismiss stale PR approvals when new commits are pushed
- ☑️ Require review from code owners (if you have CODEOWNERS file)
- ☑️ Enable this checkbox (if you plan to add automated tests)
- Why: Ensures tests pass before merging
- Impact: Medium - only affects you if you add GitHub Actions/CI
- ☑️ Enable this checkbox
- Why: Prevents merge conflicts
- Impact: Low - just keeps things clean
- Skip: Too complex for personal projects
- Skip: Not necessary for personal projects (requires GPG setup)
- Skip: Too restrictive for learning
- Skip: Only needed for high-traffic repositories
Looking at your screenshot, you should configure:
- ☑️ Check "Include administrators" if you want rules to apply to you too
- Recommendation:
⚠️ UNCHECK this for personal projects - Why: You might need to make emergency fixes
- Leave empty for personal projects
- Add specific users/apps only if you're collaborating
☑️ Block force pushes
☑️ Restrict pushes that create files larger than 100 MB
☐ Include administrators (unchecked - so you can bypass)
☑️ Block force pushes
☑️ Restrict pushes that create files larger than 100 MB
☑️ Require a pull request before merging
└── ☑️ Dismiss stale PR approvals when new commits are pushed
☐ Include administrators (unchecked)
-
Rule Name: Leave as "main" (it's correct)
-
Enforcement Status: Keep "Disabled" for now (you can enable later)
-
Bypass List: Leave empty
-
Target Branches: Shows "main" ✅
-
Branch Rules - Check these boxes:
- ☑️ Block force pushes (7th checkbox down)
- ☑️ Restrict pushes that create files larger than 100 MB (8th checkbox down)
-
Leave unchecked for now:
- ☐ Require status checks
- ☐ Require pull request reviews (enable later when comfortable)
- ☐ Restrict deletions
- ☐ Require signed commits
- ☐ Require linear history
- ☐ Require deployments to succeed
- ☐ Require merge queue
-
At the bottom:
- ☐ Include administrators (UNCHECK this so you can bypass rules)
-
Click "Create" button
- ✅ You can still push directly to main
- ✅ You can still merge branches
- ❌ You cannot force push (safety feature)
- ❌ You cannot upload files >100MB
- ❌ You cannot push directly to main branch
- ✅ You must create Pull Requests for changes
- ✅ You can still bypass rules as admin (if unchecked "Include administrators")
If you enable "Require pull request before merging":
# 1. Create a new branch for changes
git checkout -b feature/my-new-feature
# 2. Make your changes and commit
git add .
git commit -m "Add new feature"
# 3. Push the branch
git push origin feature/my-new-feature
# 4. Go to GitHub and create Pull Request
# 5. Merge the PR through GitHub interface
# 6. Delete the feature branch and pull main
git checkout main
git pull origin main
git branch -d feature/my-new-feature- Begin with just "Block force pushes"
- Get comfortable with the workflow
- Add more protections gradually
- If you get locked out, go to Settings → Branches
- Temporarily disable the rule
- Make your changes
- Re-enable protection
- Create a test repository first
- Try different settings
- See what works for your workflow
☑️ Block force pushes only
☑️ Block force pushes
☑️ Restrict file size >100MB
☑️ Block force pushes
☑️ Restrict file size >100MB
☑️ Require pull requests
☑️ All above +
☑️ Require status checks (when you add tests)
☑️ Require up-to-date branches
- You can change these settings anytime - they're not permanent
- Start conservative - you can always add more protection later
- "Include administrators" - Keep unchecked for personal projects
- Test on a dummy repo first if you're unsure
Created: September 20, 2025
For Repository: ParkerHub
User Level: Beginner
Purpose: Safe branch protection setup
