Item logo image for Main Branch Guard for GitHub

Main Branch Guard for GitHub

ExtensionDeveloper Tools
Item media 1 (screenshot) for Main Branch Guard for GitHub

Overview

Warns before you commit directly to the default branch using GitHub's web file editor.

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.

Details

  • Version
    0.1.0
  • Updated
    August 20, 2026
  • Offered by
    extenup
  • Size
    18.41KiB
  • Languages
    English
  • Developer
    Email
    extenup13@gmail.com
  • Non-trader
    This developer has not identified itself as a trader. For consumers in the European Union, please note that consumer rights do not apply to contracts between you and this developer.

Privacy

Manage extensions and learn how they're being used in your organization

Main Branch Guard for GitHub has disclosed the following information regarding the collection and usage of your data. More detailed information can be found in the developer's privacy policy.

Main Branch Guard for GitHub handles the following:

User activity
Website content

This developer declares that your data is

  • Not being sold to third parties, outside of the approved use cases
  • Not being used or transferred for purposes that are unrelated to the item's core functionality
  • Not being used or transferred to determine creditworthiness or for lending purposes

Support

For help with questions, suggestions, or problems, visit the developer's support site

Google apps