{"thread":{"id":"4861","subject":"Sharing repositories later on","startedAt":"2006-07-12T13:28:00Z","lastAt":"2006-07-12T15:57:51Z","messageCount":4,"participants":["Erik Mouw","Junio C Hamano","Linus Torvalds"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"23707","messageId":"20060712132800.GA7328@harddisk-recovery.com","threadId":"4861","inReplyTo":null,"subject":"Sharing repositories later on","fromName":"Erik Mouw","fromEmail":"erik@harddisk-recovery.com","sentAt":"2006-07-12T13:28:00Z","receivedAt":"2006-07-12T13:28:00Z","isPatch":false,"sender":{"key":"erik@harddisk-recovery.com","avatar":null},"body":"Hi,\n\nI just learned out about \"git clone -s\" to share objects between\nrepositories. How do I use that with already existing repositories?\n\nRight now I have a \"linux-2.6\" repository to track Linus's 2.6 kernel\ntree and an \"elinux-2.6\" tree that pulls from linux-2.6 and holds my\nown changes. I created a file .git/objects/info/alternates that\ncontains the line \"/home/erik/git/linux-2.6/.git/objects\". Now how do I\nget rid of the \"old\" objects and packs without loosing my changes?\n\n\nErik\n\n-- \n+-- Erik Mouw -- www.harddisk-recovery.com -- +31 70 370 12 90 --\n| Lab address: Delftechpark 26, 2628 XH, Delft, The Netherlands\n"},{"id":"23710","messageId":"7vpsgazw5j.fsf@assigned-by-dhcp.cox.net","threadId":"4861","inReplyTo":"20060712132800.GA7328@harddisk-recovery.com","subject":"Re: Sharing repositories later on","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2006-07-12T15:21:28Z","receivedAt":"2006-07-12T15:21:28Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Erik Mouw <erik@harddisk-recovery.com> writes:\n\n> Hi,\n>\n> I just learned out about \"git clone -s\" to share objects between\n> repositories. How do I use that with already existing repositories?\n>\n> Right now I have a \"linux-2.6\" repository to track Linus's 2.6 kernel\n> tree and an \"elinux-2.6\" tree that pulls from linux-2.6 and holds my\n> own changes. I created a file .git/objects/info/alternates that\n> contains the line \"/home/erik/git/linux-2.6/.git/objects\". Now how do I\n> get rid of the \"old\" objects and packs without loosing my changes?\n\nrepack -a -d -l perhaps?\n"},{"id":"23713","messageId":"Pine.LNX.4.64.0607120843570.5623@g5.osdl.org","threadId":"4861","inReplyTo":"20060712132800.GA7328@harddisk-recovery.com","subject":"Re: Sharing repositories later on","fromName":"Linus Torvalds","fromEmail":"torvalds@osdl.org","sentAt":"2006-07-12T15:47:13Z","receivedAt":"2006-07-12T15:47:13Z","isPatch":false,"sender":{"key":"torvalds@linux-foundation.org","avatar":"https://avatars.githubusercontent.com/u/1024025?v=4"},"body":"\n\nOn Wed, 12 Jul 2006, Erik Mouw wrote:\n> \n> I just learned out about \"git clone -s\" to share objects between\n> repositories. How do I use that with already existing repositories?\n\nDo\n\n\techo \"/source/git/project/.git/objects/\" > .git/objects/info/alternates\n\nand then follow it up with\n\n\tgit repack -a -d -l\n\nwhere the \"-l\" means that it will only put _local_ objects in the \npack-file (strictly speaking, it will put any loose objects from the \nalternate tree too, so you'll have a fully packed archive, but it won't \nduplicate objects that are already packed in the alternate tree).\n\n\t\tLinus\n"},{"id":"23714","messageId":"20060712155751.GE7328@harddisk-recovery.com","threadId":"4861","inReplyTo":"7vpsgazw5j.fsf@assigned-by-dhcp.cox.net","subject":"Re: Sharing repositories later on","fromName":"Erik Mouw","fromEmail":"erik@harddisk-recovery.com","sentAt":"2006-07-12T15:57:51Z","receivedAt":"2006-07-12T15:57:51Z","isPatch":false,"sender":{"key":"erik@harddisk-recovery.com","avatar":null},"body":"On Wed, Jul 12, 2006 at 08:21:28AM -0700, Junio C Hamano wrote:\n> Erik Mouw <erik@harddisk-recovery.com> writes:\n> > Right now I have a \"linux-2.6\" repository to track Linus's 2.6 kernel\n> > tree and an \"elinux-2.6\" tree that pulls from linux-2.6 and holds my\n> > own changes. I created a file .git/objects/info/alternates that\n> > contains the line \"/home/erik/git/linux-2.6/.git/objects\". Now how do I\n> > get rid of the \"old\" objects and packs without loosing my changes?\n> \n> repack -a -d -l perhaps?\n\nThanks, that did the trick. I now have a small pack with around 100\nobjects.\n\n\nErik\n\n-- \n+-- Erik Mouw -- www.harddisk-recovery.com -- +31 70 370 12 90 --\n| Lab address: Delftechpark 26, 2628 XH, Delft, The Netherlands\n"}]}