From: Nguyen Thai Ngoc Duy Date: Wed, 16 Jan 2008 04:03:42 GMT Subject: Re: I don't want the .git directory next to my code. Message-ID: In-Reply-To: <478D79BD.7060006@talkingspider.com> On Jan 16, 2008 10:27 AM, Mike wrote: > > I'm learning git and I'm really annoyed that the .git directory lives in > the same directory as my code. I don't want it there for three reasons: > > 1. My code lives on a development web server docroot, and I don't want > the .git repository to end up getting published to the live site by > accident. (I would imagine this would be a common need.) > > 2. If I tar/gz my code and deliver it to a client, I don't want the .git > dir slipping into the tarball, allowing my client to be able to peruse > the history of what we did and when. > > 3. The .git respository will get big, especially with binary files in > it, and I want it someplace with a lot of disk space. And I don't want > it to get tarred up when we migrate the site to a different server. (And > tar isn't aware of hard links is it? wonderful.) > > How do I make the repository dir live somewhere else, the hell away from > my code? Thanks Setup GIT_WORK_TREE and GIT_DIR env variables or use --git-dir and --work-tree together. See "man git" for more detail. -- Duy