From: Junio C Hamano Date: Sat, 28 Jul 2007 00:48:23 GMT Subject: Re: [PATCH 5/8] work-trees are allowed inside a git-dir Message-ID: <7vabthwdyg.fsf@assigned-by-dhcp.cox.net> In-Reply-To: Johannes Schindelin writes: >> Johannes Schindelin writes: >> >> > It is allowed to call >> > >> > $ git --git-dir=../ --work-tree=. bla >> > >> > when you really want to. In this case, you are both in the git directory >> > and in the working tree. > ... > There are files in that directory (and all of its subdirectories) of a > certain type, which are the only ones which are human generated, and > therefore precious. I like to add them, and inspect them, with > > git --git-dir=$HOME/x.git add > > and > > git --git-dir=$HOME/x.git diff I understand the --git-dir=$HOME/x.git to keep track of something in $HOME/foo/bar example. But that is not the issue you described in the original message. I was asking about this (which is the way I read your original message): $ GIT_DIR=$HOME/x.git git init $ mkdir $HOME/x.git/workroot $ cd $HOME/x.git/workroot $ git --git-dir=../ --work-tree=. That is, $HOME/x.git/ is the GIT_DIR that has HEAD, index and refs/, and you are keeping track of contents whose rootlevel is at $HOME/x.git/workroot