first commit
This commit is contained in:
11
pre-commit
Normal file
11
pre-commit
Normal file
@@ -0,0 +1,11 @@
|
||||
#!/bin/bash
|
||||
|
||||
current_branch="$(git branch --show-current)"
|
||||
for protected_branch in "main" "stable"; do
|
||||
if [[ "$protected_branch" == "$current_branch" ]]; then
|
||||
echo "ERROR: local branch $current_branch is protected"
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
|
||||
exit 0
|
||||
Reference in New Issue
Block a user