githooks

package
v1.1.13 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 3, 2025 License: MIT Imports: 0 Imported by: 0

Documentation

Overview

Package githooks is retained for backwards compatibility but no longer provides automatic hook installation.

Overview

Hitch no longer automatically installs Git hooks. Users should set up manual hook integration using the 'hitch hook' command or their preferred hook manager (lefthook, husky, etc.).

Manual Hook Integration

For manual hook integration, use the 'hitch hook' command which provides:

  • Validation to prevent direct commits to hitched environment branches
  • Clear error messages and workflow guidance
  • Integration with any hook manager

See 'hitch hook --help' for detailed usage instructions.

Hook Manager Integration

## Lefthook

Create a lefthook.yml file:

pre-commit:
  commands:
    hitch-check:
      run: hitch hook

## Native Git Hooks

Add to .git/hooks/pre-commit:

#!/bin/bash
hitch hook || exit 1

Migration from Automatic Installation

If you were using previous versions of Hitch that automatically installed hooks:

  1. No hooks will be installed automatically anymore
  2. Existing hooks will continue to work but should be updated to use 'hitch hook'
  3. Set up manual hook integration using your preferred method

Safety Features

The 'hitch hook' command provides:

  • Blocks direct commits to hitched environment branches
  • Provides clear workflow guidance
  • Works with any hook manager
  • No automatic installation or file system modifications

Best Practices

For teams using Hitch:

  1. Choose a hook manager (lefthook recommended)
  2. Add 'hitch hook' to your pre-commit hooks
  3. Commit hook configuration to version control
  4. Document hook setup in team onboarding

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL