Hi Raphael,

On Friday 02 September 2011, Raphael Manfredi wrote:
> How can I work with multiple sandboxes tied to the same GIT database?
> 
> I don't want to clone multiple copies of git everywhere here but I
> want to have several trees (between 5 and 10) with various distinct
> changed made to each of them that I can test independently.

There are different answers to that question. The short one is probably 
this: Make the second (and third etc.) clone not from the shared 
repository over the network, but directly from your first clone through 
the local filesystem. Git will then create all its immutable object files 
as hard links. You may notice by the speed of the operation that the 
contents of the object files are never physically copied.

But even in the rare cases when hard links are not possible (because you 
want the clones to reside on different machines or on different partitions 
within the same machine), there is nothing inherently bad in keeping 
several full clones, because they are not that large. In the case of 
gtk-gnutella, the .git folder that contains the repository with all its 
history is only about the same size as the current checkout. So even 
when you have _all_ your clones on different machines, making full clones 
everywhere only about doubles the disk space needed.

That said, keeping checkouts of different development branches in 
different folders is a practice that is much less useful with Git than 
with SVN, because it is (in many cases) essentially a work-around for a 
problem that doesn't exist in Git. With SVN, you often keep one checkout 
folder for every branch you're working on, because switching between 
branches is otherwise a tedious server operation. You don't do that with 
Git. Most people have only _one_ clone, even when they are working on 
ten different branches. That's because switching between branches goes 
within the blink of an eye. Most of the time, it is done before you can 
release the "enter" key after typing the "git checkout" command.
You create a new local branch for every little feature you develop, and 
you change between these branches back and forth all the time.

If you say that you want to have 15 different instances of gtk-gnutella 
_running_ simultaneously, that doesn't necessarily mean that you want to 
_compile_ them all at the same time, do you? If not, you don't need 15 
instances of source code, because you only need it while compiling or 
editing, not while running. And you can only _edit_ one copy at a time 
anyway. That probably means that you can do it "the Git way" and only 
keep one single clone. Only if you still think that you _really_ need 
multiple clones, create them locally within the same filesystem as 
indicated in the first paragraph.

Bye,
Hauke

------------------------------------------------------------------------------
Special Offer -- Download ArcSight Logger for FREE!
Finally, a world-class log management solution at an even better 
price-free! And you'll get a free "Love Thy Logs" t-shirt when you
download Logger. Secure your free ArcSight Logger TODAY!
http://p.sf.net/sfu/arcsisghtdev2dev
_______________________________________________
gtk-gnutella-devel mailing list
gtk-gnutella-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gtk-gnutella-devel

Reply via email to