threads / discuss / 4861

Sharing repositories later on

Subject: Sharing repositories later on

## tl;dr

4 messages between Jul 12, 2006 and Jul 12, 2006.

replies: 3people: 3as markdown or json

Erik Mouw· Jul 12, 2006, 13:28 UTC · lore
Hi,

I just learned out about "git clone -s" to share objects between repositories. How do I use that with already existing repositories?

Right now I have a "linux-2.6" repository to track Linus's 2.6 kernel tree and an "elinux-2.6" tree that pulls from linux-2.6 and holds my own changes. I created a file .git/objects/info/alternates that contains the line "/home/erik/git/linux-2.6/.git/objects". Now how do I get rid of the "old" objects and packs without loosing my changes?

Erik
-- 
+-- Erik Mouw -- www.harddisk-recovery.com -- +31 70 370 12 90 --
| Lab address: Delftechpark 26, 2628 XH, Delft, The Netherlands
Junio C Hamano· Jul 12, 2006, 15:21 UTC · re: Erik Mouw · lore

Re: Sharing repositories later on

Erik Mouw <erik@harddisk-recovery.com> writes:
Show 10 quoted lines
> Hi,
>
> I just learned out about "git clone -s" to share objects between
> repositories. How do I use that with already existing repositories?
>
> Right now I have a "linux-2.6" repository to track Linus's 2.6 kernel
> tree and an "elinux-2.6" tree that pulls from linux-2.6 and holds my
> own changes. I created a file .git/objects/info/alternates that
> contains the line "/home/erik/git/linux-2.6/.git/objects". Now how do I
> get rid of the "old" objects and packs without loosing my changes?
repack -a -d -l perhaps?
Erik Mouw· Jul 12, 2006, 15:57 UTC · re: Junio C Hamano · lore

Re: Sharing repositories later on

On Wed, Jul 12, 2006 at 08:21:28AM -0700, Junio C Hamano wrote:
Show 8 quoted lines
> Erik Mouw <erik@harddisk-recovery.com> writes:
> > Right now I have a "linux-2.6" repository to track Linus's 2.6 kernel
> > tree and an "elinux-2.6" tree that pulls from linux-2.6 and holds my
> > own changes. I created a file .git/objects/info/alternates that
> > contains the line "/home/erik/git/linux-2.6/.git/objects". Now how do I
> > get rid of the "old" objects and packs without loosing my changes?
> 
> repack -a -d -l perhaps?

Thanks, that did the trick. I now have a small pack with around 100 objects.

Erik
-- 
+-- Erik Mouw -- www.harddisk-recovery.com -- +31 70 370 12 90 --
| Lab address: Delftechpark 26, 2628 XH, Delft, The Netherlands
Linus Torvalds· Jul 12, 2006, 15:47 UTC · re: Erik Mouw · lore

Re: Sharing repositories later on

On Wed, 12 Jul 2006, Erik Mouw wrote:
> 
> I just learned out about "git clone -s" to share objects between
> repositories. How do I use that with already existing repositories?
Do
	echo "/source/git/project/.git/objects/" > .git/objects/info/alternates
and then follow it up with
	git repack -a -d -l

where the "-l" means that it will only put _local_ objects in the pack-file (strictly speaking, it will put any loose objects from the alternate tree too, so you'll have a fully packed archive, but it won't duplicate objects that are already packed in the alternate tree).

		Linus

← back to recent threads