Skip to content

Add pre-commit forbid-new-submodules as builtin hook #1849

@janosh

Description

@janosh

forbid-new-submodules prevents accidentally adding git submodules. It should check staged files for new .gitmodules entries or 160000 mode objects in the index and exit non-zero if any are found.

repos:
  - repo: builtin
    hooks:
      - id: forbid-new-submodules

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions