{"thread":{"id":"37396","subject":"Wishlist: git fetch --reference","startedAt":"2014-08-22T02:57:47Z","lastAt":"2014-08-22T07:01:58Z","messageCount":4,"participants":["Howard Chu","Jeff King","Dennis Kaarsemaker"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"248095","messageId":"53F6B1AB.3030706@symas.com","threadId":"37396","inReplyTo":null,"subject":"Wishlist: git fetch --reference","fromName":"Howard Chu","fromEmail":"hyc@symas.com","sentAt":"2014-08-22T02:57:47Z","receivedAt":"2014-08-22T02:57:47Z","isPatch":false,"sender":{"key":"hyc@symas.com","avatar":"https://gravatar.com/avatar/07931cfff11bc93bbafb5090ff38d3e0dda8745df2e0913457d29ead5d400462?d=mp&s=160"},"body":"I maintain multiple copies of the same repo because I keep each one checked \nout to different branch/rev levels. It would be nice if, similar to clone \n--reference, we could also use git fetch --reference to reference a local repo \nwhen doing a fetch to pull in updates.\n\n-- \n   -- Howard Chu\n   CTO, Symas Corp.           http://www.symas.com\n   Director, Highland Sun     http://highlandsun.com/hyc/\n   Chief Architect, OpenLDAP  http://www.openldap.org/project/\n"},{"id":"248099","messageId":"20140822042057.GD27992@peff.net","threadId":"37396","inReplyTo":"53F6B1AB.3030706@symas.com","subject":"Re: Wishlist: git fetch --reference","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2014-08-22T04:20:57Z","receivedAt":"2014-08-22T04:20:57Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Thu, Aug 21, 2014 at 07:57:47PM -0700, Howard Chu wrote:\n\n> I maintain multiple copies of the same repo because I keep each one checked\n> out to different branch/rev levels. It would be nice if, similar to clone\n> --reference, we could also use git fetch --reference to reference a local\n> repo when doing a fetch to pull in updates.\n\nI think it is just spelled:\n\n  echo $reference_repo >>.git/objects/info/alternates\n  git fetch\n\nWe need \"--reference\" with clone because that first line needs to happen\nafter clone runs \"git init\" but before it runs \"git fetch\". And if you\ncloned with --reference, of course, the alternates file remains and\nfurther fetches will automatically use it.\n\n-Peff\n"},{"id":"248105","messageId":"53F6D44E.7040907@symas.com","threadId":"37396","inReplyTo":"20140822042057.GD27992@peff.net","subject":"Re: Wishlist: git fetch --reference","fromName":"Howard Chu","fromEmail":"hyc@symas.com","sentAt":"2014-08-22T05:25:34Z","receivedAt":"2014-08-22T05:25:34Z","isPatch":false,"sender":{"key":"hyc@symas.com","avatar":"https://gravatar.com/avatar/07931cfff11bc93bbafb5090ff38d3e0dda8745df2e0913457d29ead5d400462?d=mp&s=160"},"body":"Jeff King wrote:\n> On Thu, Aug 21, 2014 at 07:57:47PM -0700, Howard Chu wrote:\n>\n>> I maintain multiple copies of the same repo because I keep each one checked\n>> out to different branch/rev levels. It would be nice if, similar to clone\n>> --reference, we could also use git fetch --reference to reference a local\n>> repo when doing a fetch to pull in updates.\n>\n> I think it is just spelled:\n>\n>    echo $reference_repo >>.git/objects/info/alternates\n>    git fetch\n>\n> We need \"--reference\" with clone because that first line needs to happen\n> after clone runs \"git init\" but before it runs \"git fetch\". And if you\n> cloned with --reference, of course, the alternates file remains and\n> further fetches will automatically use it.\n\nAha, thanks, hadn't realized that. Just checked and yes, the alternates file \nis already set in all of these different copies.\n\n-- \n   -- Howard Chu\n   CTO, Symas Corp.           http://www.symas.com\n   Director, Highland Sun     http://highlandsun.com/hyc/\n   Chief Architect, OpenLDAP  http://www.openldap.org/project/\n"},{"id":"248107","messageId":"1408690918.5586.3.camel@seahawk","threadId":"37396","inReplyTo":"53F6B1AB.3030706@symas.com","subject":"Re: Wishlist: git fetch --reference","fromName":"Dennis Kaarsemaker","fromEmail":"dennis@kaarsemaker.net","sentAt":"2014-08-22T07:01:58Z","receivedAt":"2014-08-22T07:01:58Z","isPatch":false,"sender":{"key":"dennis@kaarsemaker.net","avatar":"https://avatars.githubusercontent.com/u/200649?v=4"},"body":"On do, 2014-08-21 at 19:57 -0700, Howard Chu wrote:\n> I maintain multiple copies of the same repo because I keep each one checked \n> out to different branch/rev levels. It would be nice if, similar to clone \n> --reference, we could also use git fetch --reference to reference a local repo \n> when doing a fetch to pull in updates.\n\nAlternatively, you can use Duy's multiple-work-trees patches to safely\nmake multiple checkouts of one repository. These patches are in next.  \n-- \nDennis Kaarsemaker\nhttp://www.kaarsemaker.net\n"}]}