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:
- No hooks will be installed automatically anymore
- Existing hooks will continue to work but should be updated to use 'hitch hook'
- 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:
- Choose a hook manager (lefthook recommended)
- Add 'hitch hook' to your pre-commit hooks
- Commit hook configuration to version control
- Document hook setup in team onboarding
Click to show internal directories.
Click to hide internal directories.