Re: I don't want the .git directory next to my code.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, 15 Jan 2008, 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.

Generate your tarballs with "git archive", which will also make sure that 
you don't accidentally include anything else that's not committed. 
Likewise for sending to the live site, probably.

> 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.)

You'll probably want to keep your history, which is what's in .git, when 
you migrate to a different server; that's kind of the point of using 
version control...

> How do I make the repository dir live somewhere else, the hell away from my
> code? Thanks

export GIT_DIR=/somewhere-else.git

Note that this only really works if you've only got one repository; 
there's no good way to have the repository information outside of the 
working directory and still have which repository you're using depend on 
which directory you're working in.

	-Daniel
*This .sig left intentionally blank*
-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux