Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

prevent from directly committing on main locally

Abhinavbb012a5f0cbc
diff --git a/.husky/pre-commit b/.husky/pre-commit
index d2ae35e84b..4f6f06ef55 100755
--- a/.husky/pre-commit
+++ b/.husky/pre-commit
@@ -1,4 +1,11 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"
+branch="$(git rev-parse --abbrev-ref HEAD)"
+
+if [ "$branch" = "main" ]; then
+ echo "You can't commit directly to main branch"
+ exit 1
+fi
+
yarn lint-staged