* Tom Lane <t...@sss.pgh.pa.us> [090602 12:35]: > Alvaro Herrera <alvhe...@commandprompt.com> writes: > > Hmm, but is there a way to create those clones from a single local > > "database"? > > > (I like the monotone model much better. This mixing of working copies > > and databases as if they were a single thing is silly and uncomfortable > > to use.) > > I agree, .git as a subdirectory of the working directory doesn't make > much sense to me.
The main reason why git uses this is that the "index" (git equivilant of the CVS/*) resides in 1 place instead of in each directory. So, if you have multiple working directories sharing a single .git, you get them tromping on each others "index". That said, you can symlink almost everything *inside* .git to other repositories. For instance, if you had the "Reference" repository I shows last time, instead of doing the "git clone", you could do: #Make a new REL8_2_STABLE working area moun...@pumpkin:~/pg-work$ REF=$(pwd)/PostgreSQL.git moun...@pumpkin:~/pg-work$ mkdir REL8_2_STABLE moun...@pumpkin:~/pg-work$ cd REL8_2_STABLE/ moun...@pumpkin:~/pg-work/REL8_2_STABLE$ git init # And now make everything point back moun...@pumpkin:~/pg-work/REL8_2_STABLE$ mkdir .git/refs/remotes && ln -s $REF/refs/heads .git/refs/remotes/origin moun...@pumpkin:~/pg-work/REL8_2_STABLE$ rm -Rf .git/objects && ln -s $REF/objects .git/objects moun...@pumpkin:~/pg-work/REL8_2_STABLE$ rmdir .git/refs/tags && ln -s $REF/refs/tags .git/refs/tags moun...@pumpkin:~/pg-work/REL8_2_STABLE$ rm -Rf .git/info && ln -s $REF/info .git/info moun...@pumpkin:~/pg-work/REL8_2_STABLE$ rm -Rf .git/hooks && ln -s $REF/hooks This will leave you with an independent config, independent index, independent heads, and independent reflogs, with a shared "remote" tracking branches, shared "object" store, shared "tags", and shared hooks. And make sure you don't purge any unused objects out of any of these subdirs, because they don't know that the object might be in use in another subdir... This warning is the one reason why it's usually recommended to just use a reference repository, and not have to worry.. a. -- Aidan Van Dyk Create like a god, ai...@highrise.ca command like a king, http://www.highrise.ca/ work like a slave.
signature.asc
Description: Digital signature