A pre-commit hook to prevent fixup! and squash! commits from being pushed to the remote
repository.
This hook is used with: pre-commit.com.
Add a reference to this repository in your project's .pre-commit-config.yaml file:
repos:
- repo: https://github.com/garyj/fixup-squash-guard
rev: v0.2.2
hooks:
- id: check-commitsInstall the pre-commit hook:
pre-commit install --hook-type pre-pushThis command installs the pre-push hook in your local repository, ensuring it's run before each push to the remote repository.
- The hook checks all commits that are about to be pushed. If it finds any commit messages starting with
fixup!orsquash!, it aborts the push and outputs a warning message. - To bypass the check temporarily, you can use the
--no-verifyoption withgit push.
MIT