Fix · GitHub and Git
Protected branch: I cannot push to main
Not checked against the vendor's current screens
What you may see
- The push is declined because the branch is protected
- It says changes must be made through a pull request
Most likely cause
The repository has a rule that stops direct pushes to main; changes must arrive through a pull request.
Check first (about two minutes)
- Read the message: does it ask for a pull request, a review or checks?
The fix prompt
What you type here never leaves your browser. The search runs on this page, and nothing is sent to a server or to an AI.
Kept only in this browser, on this device. Keys and passwords are removed before anything is saved.
Prompt language
Paste it into Claude, ChatGPT, Gemini or Cursor, then follow what it says.
After you tried it, did it work?
Steps
- Create a branch from my work (git switch -c my-change), push that branch, and open a pull request.
- Tell me how to open the pull request on GitHub and what to write.
- Do not look for a way around the rule.
Do not do this
- Do not ask an admin to remove the rule for a one-off change.
- Do not disable branch protection.