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

Re: Any tips for improving the performance of cloning large repositories?

From
ABAlex Bennee <kernel-hacker@bennee.com>
Date
Dec 16, 2011, 18:37 UTC
Message-ID
<CAJ-05NNcORg2H_j3g-h-eDXuuGit_hNH6PG9tNq30QJwJMAPWg@mail.gmail.com>
In-Reply-To
<7vzkesigw9.fsf@alter.siamese.dyndns.org>
On 16 December 2011 17:08, Junio C Hamano <gitster@pobox.com> wrote:
Show 9 quoted lines
> Alex Bennee <kernel-hacker@bennee.com> writes:
>
>> Well that's counter intuitive....
>>
>>  - reverting the original repo to one big pack speeds up the clone
>>  - adding a --local --reference mirror slows it down
>
> Neither is. Read what "--local" says in the help text of clone. It
> disables the git aware clever optimization.
OK that's not how I read the man page:
       --local, -l
           When the repository to clone from is on a local machine,
this flag bypasses the normal "git aware" transport
           mechanism and clones the repository by making a copy of
HEAD and everything under objects and refs directories.
So this says it skips "git aware" (whatever that means)
           The files under .git/objects/ directory are hardlinked to
save space when possible. This is now the default when
           the source repository is specified with /path/to/repo
syntax, so it essentially is a no-op option. To force
           copying instead of hardlinking (which may be desirable if
you are trying to make a back-up of your repository),
           but still avoid the usual "git aware" transport mechanism,
--no-hardlinks can be used.

And this says that objects on the local file-system are hardlinked (rather than copied) which I assumed was a optimal approach.

       --no-hardlinks
           Optimize the cloning process from a repository on a local
filesystem by copying files under .git/objects
           directory.

I'm not sure how this is an optimization? This means more copying rather than linking right?

-- 
Alex, homepage: http://www.bennee.com/~alex/
http://www.half-llama.co.uk
Previous: Junio C Hamano
Message 7 of 7 in “Any tips for improving the performance of cloning large repositories?”
  1. Alex BenneeDec 16, 2011
  2. Hallvard Breien FurusethDec 16, 2011
  3. Hallvard Breien FurusethDec 16, 2011
  4. Seth RobertsonDec 16, 2011
  5. Alex BenneeDec 16, 2011
  6. Junio C HamanoDec 16, 2011
  7. Alex BenneeDec 16, 2011

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.