Regular git push to main blocked even with explicit user approval
Resolved 💬 2 comments Opened Feb 2, 2026 by ae-robertsanchez Closed Mar 3, 2026
Description
Claude Code blocks regular git push origin main commands even when:
- The user explicitly requests the push
- GitHub branch protection has been removed
- Project-level
.claude/settings.jsonis configured to allow it
The error message shown:
🚫 Blocked push from protected branch: main
Create/switch to a feature branch and push that instead.
Expected Behavior
According to the documented Git Safety Protocol, only force push to main/master should be blocked:
"NEVER run force push to main/master, warn the user if they request it"
A regular git push (non-force) should be allowed, especially when the user explicitly requests it.
Actual Behavior
All pushes to main are blocked, including regular (non-force) pushes with explicit user approval.
Use Case
Personal/operational repositories where the user is the sole contributor. The branch→PR→merge ceremony adds unnecessary friction for repos like:
- Personal dotfiles
- Ops/automation repos
- Solo projects
Reproduction Steps
- User asks Claude to commit and push changes
- Claude commits successfully
- Claude attempts
git push origin main - Push is blocked with the error above
- Even after removing GitHub branch protection, the block persists
- Even after adding project settings to allow push, the block persists
Suggested Fix
Either:
- Only block
git push --forceto main (as documented), not regular push - Allow project-level settings to override this protection
- Allow the push when user explicitly approves it
Environment
- Claude Code CLI
- macOS
- Repository: private personal ops repo
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗