git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Wishlist: git fetch --reference

From
Howard Chu <hyc@symas.com>
Date
Aug 22, 2014, 05:25 UTC
Message-ID
<53F6D44E.7040907@symas.com>
In-Reply-To
<20140822042057.GD27992@peff.net>
Jeff King wrote:
Show 16 quoted lines
> On Thu, Aug 21, 2014 at 07:57:47PM -0700, Howard Chu wrote:
>
>> I maintain multiple copies of the same repo because I keep each one checked
>> out to different branch/rev levels. It would be nice if, similar to clone
>> --reference, we could also use git fetch --reference to reference a local
>> repo when doing a fetch to pull in updates.
>
> I think it is just spelled:
>
>    echo $reference_repo >>.git/objects/info/alternates
>    git fetch
>
> We need "--reference" with clone because that first line needs to happen
> after clone runs "git init" but before it runs "git fetch". And if you
> cloned with --reference, of course, the alternates file remains and
> further fetches will automatically use it.

Aha, thanks, hadn't realized that. Just checked and yes, the alternates file is already set in all of these different copies.

-- 
   -- Howard Chu
   CTO, Symas Corp.           http://www.symas.com
   Director, Highland Sun     http://highlandsun.com/hyc/
   Chief Architect, OpenLDAP  http://www.openldap.org/project/
Previous: Jeff KingNext: Dennis Kaarsemaker
Message 3 of 4 in “Wishlist: git fetch --reference”
  1. Howard ChuAug 22, 2014
  2. Jeff KingAug 22, 2014
  3. Howard ChuAug 22, 2014
  4. Dennis KaarsemakerAug 22, 2014

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.