Skip to content

Commit 7625657

Browse files
authored
Update README.md
1 parent 2f3ec3f commit 7625657

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

README.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,3 +225,32 @@ example, on macOS, add this to `~/.zshenv`:
225225
```sh
226226
export SIMPLE_GIT_HOOKS_RC="$HOME/.simple-git-hooks.rc"
227227
```
228+
229+
### When migrating from `husky` git hooks are not running
230+
231+
**Why is this happening?**
232+
233+
Husky might change the `core.gitHooks` value to `.husky`, this way, git hooks would search `.husky` directory instead of `.git/hooks/`.
234+
235+
Read more on git configuration in [Git book](https://git-scm.com/docs/githooks)
236+
237+
You can check it by running this command inside of your repo:
238+
239+
`git config core.hooksPath`
240+
241+
If it outputs `.husky` then this is your case
242+
243+
**How to fix?**
244+
245+
you need to point `core.gitHooks` value to `your-awesome-project/.git/hooks`. You can use this command:
246+
247+
`git config core.hooksPath .git/hooks/`
248+
249+
validate the value is set:
250+
251+
`git config core.hooksPath`
252+
253+
should output: `.git/hooks/`
254+
255+
Then remove the `.husky` folder that are generated previously by `husky`.
256+

0 commit comments

Comments
 (0)