diff --git a/.husky/pre-commit b/.husky/pre-commit index 9348d24..c43da26 100644 --- a/.husky/pre-commit +++ b/.husky/pre-commit @@ -1,2 +1,9 @@ # .husky/pre-commit -yarn lint-staged \ No newline at end of file +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 \ No newline at end of file diff --git a/.husky/pre-push b/.husky/pre-push new file mode 100644 index 0000000..e8f3c80 --- /dev/null +++ b/.husky/pre-push @@ -0,0 +1,12 @@ +# .husky/pre-push +branch="$(git rev-parse --abbrev-ref HEAD)" + +while read local_ref local_sha remote_ref remote_sha +do + echo $local_ref + echo $local_sha + echo $remote_ref + echo $remote_sha +done + +exit 1 \ No newline at end of file