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

Re: git repack with a --reference

From
Brandon Casey <casey@nrlssc.navy.mil>
Date
May 7, 2009, 17:14 UTC
Message-ID
<y6_KSeeksmCZ_XvwgBeZd4SDdo0CcdL0TgPJ6Py336qsFto6evR0vA@cipher.nrlssc.navy.mil>
In-Reply-To
<4A0261D8.8040105@catalyst.net.nz>
Jonathan Harker wrote:
Show 11 quoted lines
> Hi - hope this isn't too noobish but I'm trying to get an existing git
> checkout to repack/prune/gc itself such that it would be like I had
> cloned it with --reference /path/to/local/repo (i.e. I've added
> /path/to/local/repo to .git/objects/info/alternatives, and I'd like it
> to reduce its objects from 200 MB to 5 MB). Is this
> 
> a. possible,
> 
> b. desirable, and
> 
> c. not insane?
yes,yes,yes.

The path written to .git/objects/info/alternates (also notice spelling of "alternates") should be the path to the objects directory, not to the toplevel repository.

i.e.
   /path/to/local/repo.git/objects
It should work properly since git v1.6.2.3.
-brandon
Previous: Miles Bader
Message 3 of 3 in “git repack with a --reference”
  1. Jonathan HarkerMay 7, 2009
  2. Miles BaderMay 7, 2009
  3. Brandon CaseyMay 7, 2009

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.