Skip to content

Guard main instead of master in no-commit-to-branch hook - #247

Open
antonwolfy wants to merge 1 commit into
mainfrom
fix-precommit-branch-main
Open

Guard main instead of master in no-commit-to-branch hook#247
antonwolfy wants to merge 1 commit into
mainfrom
fix-precommit-branch-main

Conversation

@antonwolfy

Copy link
Copy Markdown
Collaborator

Summary

The no-commit-to-branch pre-commit hook was configured to guard the master branch, but this repository's default branch is main — there is no master branch. This meant the hook was effectively guarding a nonexistent branch.

This updates the hook's --branch argument from master to main so direct commits to the default branch are actually blocked.

Changes

  • .pre-commit-config.yaml: args: [--branch, "master", ...]args: [--branch, "main", ...]

The repository's default branch is 'main'; there is no 'master' branch,
so the no-commit-to-branch pre-commit hook was guarding a nonexistent
branch.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@antonwolfy
antonwolfy force-pushed the fix-precommit-branch-main branch from f4a7bc3 to 189398e Compare July 29, 2026 11:32
@antonwolfy antonwolfy changed the title Guard 'main' instead of 'master' in no-commit-to-branch hook Guard main instead of master in no-commit-to-branch hook Jul 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant