{"thread":{"id":"34841","subject":"git fetch --reference","startedAt":"2013-09-03T16:55:29Z","lastAt":"2013-09-03T17:19:46Z","messageCount":2,"participants":["Yann Droneaud","Andreas Schwab"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"226629","messageId":"ae657fa74373b58feba41615d335504e@meuh.org","threadId":"34841","inReplyTo":null,"subject":"git fetch --reference","fromName":"Yann Droneaud","fromEmail":"ydroneaud@opteya.com","sentAt":"2013-09-03T16:55:29Z","receivedAt":"2013-09-03T16:55:29Z","isPatch":false,"sender":{"key":"ydroneaud@opteya.com","avatar":"https://avatars.githubusercontent.com/u/881377?v=4"},"body":"Hi,\n\nI surprised myself trying to run git fetch --reference <local directory> \n<remote>\nin the hope git would use my <local directory> to resolve objects \npresent in <remote> but not\nin my current repository ... just like git clone --reference <local \ndirectory> <URL>:\n\n--reference <repository>\n            If the reference repository is on the local machine, \nautomatically setup\n            .git/objects/info/alternates to obtain objects from the \nreference repository.\n            Using an already existing repository as an alternate will \nrequire fewer objects\n            to be copied from the repository being cloned, reducing \nnetwork and local storage\n            costs.\n\ngit fetch --reference would set up a temporary objects/info/alternates \n... and skrew everything up.\n\nHaving a git fetch --reference option would be great, so that I could \nfetch one remote and the other related one in a row without any special \nsetup. [At this point, you're likely to suggest me to use a local mirror \nthat I would git clone/fetch from, and your probably right, but for a \none time hack, it's cumbersome.]\n\nIn the end I've read \nhttp://git-blame.blogspot.fr/2012/08/bringing-bit-more-sanity-to-alternates.html\n\nFirst I thought having \"git alternatives add\" would enable me to \ntemporary add the --reference <directory>\nbefore running git fetch ... But it seems --reference doesn't work as I \nfirst understand it:\ngit clone --reference don't *copy* object from the --reference \n<repository> instead of *copying* them from the cloned <url>, eg. using \n--reference <repository> as kind of mirror.\nInstead --reference <repository> seems to add a kind of a symlink. And \nif the --reference <repository> disappear, things are going to be lost.  \nSee this : \nhttp://randyfay.com/content/git-clone-reference-considered-harmfu\n\nSo setting a temporary alternate with git fetch --reference is a \nnon-sense ...\nTo achieve what I intend to do with this option, a git repack would need \nto be issued to actually\ncopy the objects from the --reference <repository>.\n\nSo what's the best way to do a git fetch <remote>, copying objects from \nanother local repository\nto resolve delta ?\n\nRegards.\n\n-- \nYann Droneaud\nOPTEYA\n"},{"id":"226639","messageId":"m2ppspkekt.fsf@linux-m68k.org","threadId":"34841","inReplyTo":"ae657fa74373b58feba41615d335504e@meuh.org","subject":"Re: git fetch --reference","fromName":"Andreas Schwab","fromEmail":"schwab@linux-m68k.org","sentAt":"2013-09-03T17:19:46Z","receivedAt":"2013-09-03T17:19:46Z","isPatch":false,"sender":{"key":"schwab@linux-m68k.org","avatar":"https://avatars.githubusercontent.com/u/2175493?v=4"},"body":"Yann Droneaud <ydroneaud@opteya.com> writes:\n\n> So what's the best way to do a git fetch <remote>, copying objects from\n> another local repository\n> to resolve delta ?\n\nIMHO the best way is to add a remote for the local repository, fetch\nfrom it, then fetch from <remote>.\n\nAndreas.\n\n-- \nAndreas Schwab, schwab@linux-m68k.org\nGPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5\n\"And now for something completely different.\"\n"}]}