See the answer that I linked to this question:
https://stackoverflow.com/a/8603156/1445967
I could not get this to work at all under the latest Git for windows. (Windows 7 x64)
I used git bash:
<my username> /d/<worktree>
$ git --git-dir=/c/dev/gitrepo/repo.git --work-tree=. init && echo "gitdir: /c/dev/gitrepo/repo.git" > .git
Initialized empty Git repository in c:/dev/gitrepo/repo.git/
Then I tried:
<my username> /d/<worktree>
$ git status
fatal: Not a git repository: /c/dev/gitrepo/repo.git
So I tried something slightly different, thanks to the way windows paths get stored...
<my username> /d/<worktree>
$ git --git-dir=/c/dev/gitrepo/repo.git --work-tree=/d/<worktree> init && echo "gitdir: /c/dev/gitrepo/repo.git" > .git
Initialized empty Git repository in c:/dev/gitrepo/repo.git/
This is copy-paste verbatim except I changed my username and a single directory name to <worktree>
for SO.
Then I tried the following:
<my username> /d/<worktree>
$ git status
fatal: Not a git repository: /c/dev/gitrepo/repo.git
Then I looked inside /c/dev/gitrepo/repo.git/config and I saw this:
worktree = d:/<worktree>
Maybe this won't work with the windows path notation. So I changed it:
worktree = /d/<worktree>
Still no luck. Is what I am trying to do possible under git for Windows?