Skip to content
/ husky Public

Husky is a Git hook manager that allows you to configure and manage your hooks in a simple and efficient way.

License

Notifications You must be signed in to change notification settings

vkunssec/husky

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

52 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Husky

Husky

Go Coverage License version

Husky is a Git hook manager that allows you to configure and manage your hooks in a simple and efficient way. This package is written in Go and is compatible with all operating systems.

Features

  • Support for multiple hooks
  • Simple installation and usage
  • Compatible with all operating systems

Installation

go install github.com/vkunssec/husky@latest

Usage

Initialization

To start using Husky in your project:

husky init

To force initialization in an existing project:

husky init --force

This command will:

  • Configure the basic hook structure
  • Prepare the Git environment

Adding Hooks

To add a new hook:

husky add <hook-name> '<comando>'

Example:

husky add pre-commit 'go test ./...'

See the examples folder for more examples of implemented hooks.

Supported Hooks

  • Commit Hooks

    • pre-commit
    • prepare-commit-msg
    • commit-msg
    • post-commit
    • post-commit-msg
  • Merge Hooks

    • pre-merge
    • pre-merge-commit
    • post-merge
    • post-merge-commit
  • Rebase Hooks

    • pre-rebase
    • pre-rebase-commit
    • post-rebase
    • post-rebase-commit
  • Push Hooks

    • pre-push
    • update
  • Patch Hooks

    • pre-applypatch
    • post-applypatch
  • Others

    • post-checkout

Installing Hooks

To install the configured hooks:

husky install   

Directory Structure

After initialization, Husky creates the following structure:

.
├── .git/
│   └── hooks/          # Git hooks (managed by Husky)
└── .husky/
    └── hooks/          # Your custom hooks

Contributing

Contributions are welcome! Please feel free to submit pull requests.

License

MIT License

Author

Victor Martins

Buy Me A Coffee

About

Husky is a Git hook manager that allows you to configure and manage your hooks in a simple and efficient way.

Topics

Resources

License

Stars

Watchers

Forks