I have a case where I need to create a post-receive hook under $REPO_NAME/.git/hooks/post-receive
.
What I'm trying to do is to make this file $REPO_NAME/.git/hooks/post-receive
part of my repository and can be cloned as well.
I need to make this file exist and available to be used by any user clone my repo.
I tried to commit and push it but it's failed since .git
dir is ignored by default by Git
[$MY_REPO/.git/hooks]>git add post-receive
fatal: this operation must be run in a work tree
Any idea/workaround about how to resolve this issue.
Note: I know I can use github webhook but I need to do some customized process so that I need to use git web hook.
Appreciate your help