evilmartians / lefthook

Fast and powerful Git hooks manager for any type of projects.
MIT License
4.89k stars 213 forks source link

lefthook.yml created in every directory #221

Closed vishal1132 closed 3 years ago

vishal1132 commented 3 years ago

Hi, i have installed lefthook for mac via homebrew and then lefthook install in a particular directory where defined pre-commit hook for lefthook. Now whenever i commit in any repository in any directory, if the lefthook file is not present it's automatically created. I don't want lefthook to be a part of all my projects. How to resolve that?

Envek commented 3 years ago

This is very weird!

What is your git hooks path in your repositories? E.g. what git rev-parse --git-path hooks returns in different repos? It should be .git/hooks everywhere (so, every repo should have its own local set of hooks)

vishal1132 commented 3 years ago

@Envek Oh, I have had global git hooks configured, is it because of that? when i was not using lefthook, i created my separate binary to check for upstreams and then run some hooks based on that.

Envek commented 3 years ago

Yeah, exactly. Not sure how lefthook should behave in such situation.

vishal1132 commented 3 years ago

@Envek I see, thanks for the reply. I guess I will close this, and remove the global githook and check and might open again if the issue persists?

vishal1132 commented 3 years ago

The lefthook works as desired when disabling global githooks.