You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using Git Worktrees the Git Hooks are not set up properly.
Steps to reproduce
Expected behavior
The pre-commit hook should run.
Additional context
Before using moon to manage the Git Hooks I had some hooks in my project set up with husky(https://github.com/typicode/husky) which was working properly with git worktree.
The text was updated successfully, but these errors were encountered:
To be honest, I'm still pretty new to using git worktrees, too. I've been using it for about 2 months now.
There is no .git folder in the root of the repo, but content that is normally in the .git folder there instead, the hooks folder with the example hooks too.
If you create a new worktree folder for a branch, it doesn't contain a .git folder either, just a .git file with a key gitdir and an absolute path to the repo root folder.
for example:
/home/benjamin/repos/example/branchname/.git:
gitdir: /home/benjamin/repos/example/branchname
I assume you can tell that the folder you are in is a worktree folder because the .git folder is a file with the gitdir field and I assume you can just put the hooks in the hooks folder in the root folder.
Btw the git root command points to the root of the branch folder when I use git worktree and not to the root of the repo.
I hope this helps, let me know if there is anything else I should test/try out.
Describe the bug
When using Git Worktrees the Git Hooks are not set up properly.
Steps to reproduce
Expected behavior
The pre-commit hook should run.
Additional context
Before using moon to manage the Git Hooks I had some hooks in my project set up with husky(https://github.com/typicode/husky) which was working properly with git worktree.
The text was updated successfully, but these errors were encountered: