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

Re: Local clones aka forks disk size optimization

From
Andrew Ardill <andrew.ardill@gmail.com>
Date
Nov 15, 2012, 00:18 UTC
Message-ID
<CAH5451nW2esQR8XaAttT3tYJZEw1Nj3OEMgkHsMZrZDxhcRXHw@mail.gmail.com>
In-Reply-To
<CALZVapmO61d8yXfXXGx6Qc444ka+8n7HabuNRt0rJdE5qy_7aQ@mail.gmail.com>
On 15 November 2012 10:42, Javier Domingo <javierdo1@gmail.com> wrote:
Show 11 quoted lines
> Hi,
>
> I have come up with this while doing some local forks for work.
> Currently, when you clone a repo using a path (not file:/// protocol)
> you get all the common objects linked.
>
> But as you work, each one will continue growing on its way, although
> they may have common objects.
>
> Is there any way to avoid this? I mean, can something be done in git,
> that it checks for (when pulling) the same objects in the other forks?
Have you seen alternates? From [1]:
Show 15 quoted lines
> How to share objects between existing repositories?
> ---------------------------------------------------------------------------
>
> Do
>
> echo "/source/git/project/.git/objects/" > .git/objects/info/alternates
>
> and then follow it up with
>
> git repack -a -d -l
>
> where the '-l' means that it will only put local objects in the pack-file
> (strictly speaking, it will put any loose objects from the alternate tree
> too, so you'll have a fully packed archive, but it won't duplicate objects
> that are already packed in the alternate tree).
[1] https://git.wiki.kernel.org/index.php/GitFaq#How_to_share_objects_between_existing_repositories.3F
Regards,
Andrew Ardill
Previous: Javier DomingoNext: Javier Domingo
Message 2 of 13 in “Fwd: Local clones aka forks disk size optimization”
  1. Javier DomingoNov 14, 2012
  2. Andrew ArdillNov 15, 2012
  3. Javier DomingoNov 15, 2012
  4. Andrew ArdillNov 15, 2012
  5. Javier DomingoNov 15, 2012
  6. Andrew ArdillNov 15, 2012
  7. Sitaram ChamartyNov 15, 2012
  8. Michael J GruberNov 16, 2012
  9. Enrico WeigeltNov 16, 2012
  10. Sitaram ChamartyNov 18, 2012
  11. Enrico WeigeltNov 18, 2012
  12. Pyeron, Jason J CTR (US)Nov 16, 2012
  13. Jörg RosenkranzNov 18, 2012

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.