Warns before you commit directly to the default branch using GitHub's web file editor.
Users
2
−1 in 30 days
Rating
0.0 / 5
unchanged in 30 days
Ratings
0
0 in 30 days
Store rank
#368K
#277K among extensions
Version
0.1.0
updated 20 Aug 2026
Users
monthly, 2 months
Latest, 15 Oct 2026:2 usersMove the mouse over the chart for any month
Ratings count
monthly, 2 months
Latest, 15 Oct 2026:0 ratingsMove the mouse over the chart for any month
The Chrome Web Store rounds user counts down to the leading digit, so the user line moves in steps. The ratings count is exact and is the better signal of real adoption.
About Main Branch Guard for GitHub
GitHub's web-based file editor defaults its commit dialog to "Commit directly to the [branch] branch" — even when that branch is the repository's default branch. One misclick, and a change skips code review entirely.
Main Branch Guard watches for exactly that moment: you clicking "Commit changes" while "Commit directly" is selected and the branch you're editing is the repository's own default branch. When that happens, it pauses the commit with a small on-page warning offering two choices — switch to "Create a new branch and start a pull request," or commit anyway if that's really what you meant.
How it works:
1. Open any file in GitHub's web editor (the /edit/ view).
2. Make your change and click "Commit changes...".
3. If "Commit directly to the [branch] branch" is selected and that branch is the repository's default, Main Branch Guard pauses the submission and asks — "Create a branch instead" or "Commit anyway."
4. Editing a non-default branch, or already choosing "Create a new branch," commits normally with no interruption.
Privacy and scope:
- Runs only on GitHub's file-editor pages.
- Reads only the branch names and commit-option selection GitHub already shows on the page.
- Never commits, creates a branch, or opens a pull request itself — both warning choices only select GitHub's own radio option or replay GitHub's own Commit button.
- No network requests, storage, analytics, accounts, advertising, or remote code.
Main Branch Guard does one narrow job: make sure a direct commit to your default branch is a decision, not a default.