README.md

June 8, 2026 ยท View on GitHub

Private collection of pre-commit hooks

Available hooks

verify-git-email

This hook verifies that a committer's email address matches a domain.

This hook can serve two use cases:

  • Ensure people hide their private email addresses, e.g. by using the respective GitHub setting. --domains is set to users.noreply.github.com by default to cover this use case. Note that GitHub provides a way to block pushes that contain private email addresses that are enforced on push, while this hook enforces on commit.

  • Ensure that people within an organisation commit with their org email address instead of their private address. This is most useful for private repositories where the email does not need to be hidden and where people should be prevented to accidentially commit with their private email address.

How to use the hooks

You can include the hooks like this in your repo:

# in .pre-commit-config.yaml in your git repo root
repos:

  - repo: https://github.com/lorenzwalthert/pre-commit-hooks
    rev: 4305ba8
    hooks:
      - id: verify-git-email
        args: [--domains=my.domain]