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-commits
Install the pre-commit hook:
pre-commit install --hook-type pre-push
This 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-verify
option withgit push
.
MIT