How to force GIT post-receive hook not to be executed by the client
===

New to GIT trying to implement a workflow.

Our local office setup uses a shared Debian Samba disk with Apache, Linux, etc. We therefore clone projects from a "local path" of type `w:/webs/site.com/site.git` This are BARE repos.

We've created a bash script as a "post-receive" hook located on **w:/webs/site.com/site.git/hooks/post-receive** wich we thought would be executed by the "linux" git at something like `/home/samba/webs/site.com/hooks... that includes a conditional script depending on the branch commited to checkout similar to:

    GIT_WORK_TREE=/home/samba/webs/site.com/html git checkout -f $BRANCH

The problem is that when we PUSH from our tortoiseGIT local copy to the origin branch the hook fails with a:

> remote: fatal: Could not switch to 'C:/Program Files
> (x86)/Git/home/samba/webs/site.com/html': No such file or
> directory To w:/webs/site.com/site.git

Which we understand means the WORK_TREE or whole hook script is being executed by the clients GIT.

The problem is that we plan to open SSH and other access to the repos, so if we used Windows local paths those would fail when we push from a non Windows local network client. The alternative might be to PULL the repos via SSH even if locally but we feel this is rather inefficient and would only be required for this hook issue.

Any suggestions and/or GIT variables we could use that can be compatible with both? Thanks.
