Update git hooks to protect main branch and force good practices
This commit is contained in:
parent
3713812956
commit
c5cf78510a
@ -1,2 +1,9 @@
|
||||
# .husky/pre-commit
|
||||
yarn lint-staged
|
||||
|
||||
branch="$(git rev-parse --abbrev-ref HEAD)"
|
||||
|
||||
if [ "$branch" = "main" ]; then
|
||||
echo "You can't commit directly to main branch"
|
||||
exit 1
|
||||
fi
|
||||
Loading…
Reference in New Issue
Block a user