Ryan is an engineer in the Sacramento Area with a focus in Python, Ruby, and Rust. Bash/Python Exercism mentor. Coding, physics, calculus, music, woodworking. Looking for work!
There are a couple of ways that I've found to do this.
Create a separate directory such as ./hooks to hold your hooks. Then use a setup script to copy them into your .git/hooks directory after cloning. (i.e. git clone ... && ./setup.sh)
If you're on Git 2.9 or later, there is a config setting to hook that up. git config core.hooksPath hooks. You can similarly add this line to any makefile/init/setup script.
If your work on javascript projects, then using github.com/typicode/husky would solve all those problems. npm install hooks up everything for every developer. In JS, you have to run npm install to get started on a project.
There are a couple of ways that I've found to do this.
Create a separate directory such as
./hooks
to hold your hooks. Then use a setup script to copy them into your.git/hooks
directory after cloning. (i.e.git clone ... && ./setup.sh
)If you're on Git 2.9 or later, there is a config setting to hook that up.
git config core.hooksPath hooks
. You can similarly add this line to any makefile/init/setup script.If you're doing JavaScript, there's shared-git-hooks as well.
Let me know if you find a better way!
Yeah, where my concern is, making sure developers do this when they first clone the repo. I will keep looking
If your work on javascript projects, then using github.com/typicode/husky would solve all those problems.
npm install
hooks up everything for every developer. In JS, you have to run npm install to get started on a project.Thank you very much