I have a windows machine setup with a something like this:
N:\path\to\dir\project1.git
N:\path\to\dir\running_dir
where N:
is a mapped network drive.
I'm trying to automatically checkout project1.git
in my running_dir
upon pushing to project1.git
. I have followed this post on exporting GIT_WORK_TREE; however, I am confused on what path to use in my post-receive
hook:
#!/bin/sh
GIT_WORK_TREE= ????????
export GIT_WORK_TREE
git checkout -f
Suppose that N:
maps to C:\a\b
on the remote windows machine.
Currently trying: /c/a/b/path/to/dir/running_dir
edit: Also trying:
git --work-tree=/c/a/b/path/to/dir/running_dir checkout -f
and getting: fatal: this operation must be run in a work tree
Adding absolute paths weren't working - regardless what I tried. Easily fixed by supplying a relative path to --work-tree
though