0

Is there a git setting to avoid other devs to commit from a subfolder? I want to set this to always run husky commands when a commit is made

  • Allow: project/
  • Dont allow: project/subfolder/
LuisEnMarroquin
  • 1,609
  • 1
  • 14
  • 26

1 Answers1

1

There is no such git setting.

You can customise your workflow by using git hooks. (client side hook like pre-commit-hooks or with server side hooks)

Rajeev Bera
  • 2,021
  • 1
  • 16
  • 30
  • 1
    But git hooks are not propagated to the client when the repo is `clone`d, so he'll still need some way to install the (presumably pre-commit) hook in the repos of all the devs. See discussion [here](https://stackoverflow.com/q/25062860/12859753) – Bill Jetzer Mar 29 '22 at 17:21
  • You can use server side hooks to validate the pull request. – Rajeev Bera Mar 29 '22 at 17:24
  • Probably serverside hooks will do the trick, thanks – LuisEnMarroquin Mar 29 '22 at 17:30