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

Re: git clone out of memory. alternatives?

From
Linus Torvalds <torvalds@linux-foundation.org>
Date
Mar 28, 2008, 03:04 UTC
Message-ID
<alpine.LFD.1.00.0803272001120.14670@woody.linux-foundation.org>
In-Reply-To
<beb5fde90803271929u40a98915ifd05234476ab92f9@mail.gmail.com>
On Thu, 27 Mar 2008, Jeffrey Chang wrote:
> 
> Is there any way to get around this problem?  For example:
> - Can I run git clone in a way that uses less memory, such as cloning
> a piece of the repository at a time?

Cloning really is pretty memory-intensive, because it involves going through every single object.

What you *can* do is to limit cloning to the rsync protocol, which is strictly quite horrible (none of the inherent sanity-checks of the native protocol), but it avoids the server-side costs.

However, you'll eventually hit other problems, like the fact that you also won't be able to do a full repack on the server side (because a full repack does the same thing).

> - Can I export the entire repository as a file that can be loaded on
> my target machine, like "svnadmin dump" for subversion?
That's essentially what a repack does. See above about the problem.
> - Can I just rsync the repository from another computer that already has a copy?

Yes. You can. And you can also repack on another host and then rsync the results back to the server. It's not pretty, but it should work.

		Linus
Previous: Jeffrey ChangNext: Johannes Schindelin
Message 2 of 3 in “git clone out of memory. alternatives?”
  1. Jeffrey ChangMar 28, 2008
  2. Linus TorvaldsMar 28, 2008
  3. Johannes SchindelinMar 28, 2008

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.