Block pushes and commits to main with git hooks
pre-push rejects any push that would update refs/heads/main, however the command is spelled; pre-commit and pre-merge-commit refuse commits while main is checked out. npm install enables them via core.hooksPath. The README documents the three layers of protection for main. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
183e44db62
commit
8b08c7b27a
6 files changed
+84
-1
No files matched your search
+2
-1
@@ -6,7 +6,8 @@
|
||||
"bin": { "todo": "./src/cli.js" },
|
||||
"scripts": {
|
||||
"start": "node src/cli.js",
|
||||
"test": "node --test"
|
||||
"test": "node --test",
|
||||
"prepare": "git config core.hooksPath .githooks"
|
||||
},
|
||||
"engines": { "node": ">=20" },
|
||||
"license": "MIT"
|
||||
|
||||
Reference in new issue
Block a user