From: redstun Date: Sat, 05 Feb 2011 14:24:25 GMT Subject: Re: [idea] separate .git dir and the working tree Message-ID: In-Reply-To: <20110205132708.GA18391@elie> Making .git a symbol link is nice. Regarding the GIT_DIR variable, looks like it needs to be paired with the GIT_WORK_TREE variable, does this mean that I can only have one local git repository? what I wanted is, I may have multiple git working tree in my $HOME, like: $HOME/proj1 $HOME/proj2, I then wanted their .git directories respectively located at /safe/disk/.git_proj1 /safe/disk/.git_proj2 How can I get this? I tried to read the doc but didn't have much luck. Thanks On Sat, Feb 5, 2011 at 9:27 PM, Jonathan Nieder wrote: > (restoring cc list; please do not cull cc's) > > Mike Gant wrote: >> On Sat, Feb 05, 2011 at 10:53:58AM +0800, redstun wrote: > >>> I think separating the .git directory from its working tree could >>> increase the safety of the data to one more level higher. > [...] >> GIT_DIR and GIT_WORK_TREE might be what you are looking for. Explanation >> of usage in 'man git' > > The .git directory is allowed to be a symlink.  Or a file like so > >        gitdir: /path/to/git/repo > > for symlink-challenged operating systems.  See gitrepository-layout(7) > for details. > > Cheers, > Jonathan >