I have been developing in JavaScript for a while now and one of my favourite tool was husky but when I started developing on golang I really missed the husky tool to manage my git hooks so I created a spin off to husky written in golang.
Lets see how you can use it?
Installation
go install github.com/automation-co/husky@latest
Getting Started
You can initialise husky by $ husky init
Make sure you have git initialised
This will make the .husky folder with the hooks folder and a sample pre-commit hook
You can add hooks using
$ husky add <hook> "
<your commands for that hook>
"
Example
$ husky add pre-commit "
go build -v ./...
go test -v ./...
"
If you have made any other changes in the hooks you can appply them by using $ husky install
Get Familiar with Git Hooks
Learn more about git hooks from these useful resources:
- https://git-scm.com/book/en/v2/Customizing-Git-Git-Hooks
- https://www.atlassian.com/git/tutorials/git-hooks
- https://medium.com/@f3igao/get-started-with-git-hooks-5a489725c639
Other Alternatives
If you feel husky does not fulfill your needs you can also check out:
Top comments (2)
op sir
Thank you sir