Skip to content

Commit 144ec14

Browse files
committed
removing the example script
1 parent 24cca8a commit 144ec14

File tree

1 file changed

+0
-24
lines changed

1 file changed

+0
-24
lines changed

docs/pre-push-branch-check.md

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -74,27 +74,3 @@ git config --global core.hooksPath ~/.git-hooks
7474
➡ Allowed with a warning.
7575

7676
---
77-
78-
## Quick Install Script
79-
```bash
80-
mkdir -p ~/.git-hooks && \
81-
cat > ~/.git-hooks/pre-push <<'EOF'
82-
#!/bin/sh
83-
branch="$(git symbolic-ref --short HEAD)"
84-
override_flag="--break_glass_to_push_main"
85-
86-
if [ "$branch" = "main" ] || [ "$branch" = "master" ]; then
87-
case "$*" in
88-
*"$override_flag"* )
89-
echo "⚠️ Override used: pushing to '$branch'..."
90-
;;
91-
*)
92-
echo "❌ Push to '$branch' is disabled locally."
93-
echo " If you **really** need to, use: git push $override_flag"
94-
exit 1
95-
;;
96-
esac
97-
fi
98-
EOF
99-
chmod +x ~/.git-hooks/pre-push
100-
git config --global core.hooksPath ~/.git-hooks

0 commit comments

Comments
 (0)