I\'m trying to build a pre-commit script in git. In that script I plan on running tasks if a certain folder has changed. To test, in my script I have
git d
-
Even though GIT_DIR is set, I would still try a:
git --git-dir=/full/path/to/repo/.git --work-tree=/full/path/to/rpeo diff --cached |grep -q "^my/folder"
That way, you are sure the hook is executed where it is supposed to.
讨论(0)
-
unset GIT_DIR
cleared it up. I'm disappointed that --git-dir
did not.
讨论(0)
- 热议问题