From: Dale R. Worley Date: Fri, 18 Oct 2013 22:50:32 GMT Subject: Re: [git-users] Problem using detached worktrees with commands implemented in scripts Message-ID: <201310182250.r9IMoW57003157@freeze.ariadne.com> In-Reply-To: > From: Junio C Hamano > Now, when you say "the cwd contains the .git directory", do you mean > > cd /repositories > git add ../working/trees/proj-wt1/file > > updates "file" in the /repositories/proj.git/index? Or do you mean > this? The pattern I use is to have this: /repository/.git /working/... then cd /repository git add /working/x/y/z works as you'd expect it to. "git rm" seems to work correctly under these circumstances as well. I seem to recall that using relative values doesn't work under some conditions involving symbolic links, but I can't recall the details right now. > you talk about starting Git command _outside_ the working tree > (whether the working tree has its repository embedded in it is not > very relevant). The above pattern is what I mean, where the cwd is not within the work tree. Dale