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

Re: Priming git clone with a local repo?

From
Junio C Hamano <gitster@pobox.com>
Date
Jul 11, 2013, 16:01 UTC
Message-ID
<7vtxk1rsqc.fsf@alter.siamese.dyndns.org>
In-Reply-To
<20130711093532.GA28255@inner.h.apk.li>
Andreas Krey <a.krey@gmx.de> writes:
Show 6 quoted lines
> I'm wondering if there is (or will be) a way of doing almost
>
>   git clone --reference localrepo host:canonrep
>
> Basically, I don't want the implications of --reference but still the
> performance advantages of reusing local objects/pack files.

I think the standard operating procedure for that is to still clone with the "--reference" option first, and then do "repack -a -d" in the resulting clone (note the lack of "-l" option in "repack").

After that repack, you should be able to discard the alternates file.

    $ git clone --reference ../there otherhost:repo ours.git
    $ cd ours.git
    $ git repack -a -d ;# no "-l"!!!
    $ mv .git/objects/info/alternates .git/objects/info/alter-nates
    $ git fsck
    $ rm .git/objects/info/alter-nates
Previous: Andreas KreyNext: Junio C Hamano
Message 9 of 10 in “A local shared clone is now much slower”
  1. Stephen RothwellJul 8, 2013
  2. Duy NguyenJul 8, 2013
  3. Stephen RothwellJul 8, 2013
  4. Jeff KingJul 8, 2013
  5. Duy NguyenJul 8, 2013
  6. Junio C HamanoJul 8, 2013
  7. Jeff KingJul 9, 2013
  8. Priming git clone with a local repo?Andreas Krey, Jul 11, 2013
  9. Junio C HamanoJul 11, 2013
  10. Junio C HamanoJul 8, 2013

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.