You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
chore: prevent direct commits and pushes to main branch (#281)
# Prevent direct commits and pushes to main branch
This PR adds git hooks to prevent accidental direct commits and pushes to the main branch, enforcing a workflow where changes must go through pull requests.
The implementation:
- Adds a pre-commit hook that checks if the current branch is main and blocks commits if it is
- Creates a pre-push hook script that prevents:
- Pushing from the main branch
- Pushing to the main branch (including cases like `git push origin feature:main`)
These hooks are configured in lefthook.yml and will help maintain code quality by ensuring all changes to main go through proper review.
0 commit comments