Re: Local clones aka forks disk size optimization
- From
Javier Domingo <javierdo1@gmail.com>
- Date
- Nov 15, 2012, 00:40 UTC
- Message-ID
- <CALZVap=kOwOpxeu8+_+5uQYZz3GNC8Ep_JeK7WCQHtu+Hn3rUw@mail.gmail.com>
- In-Reply-To
- <CAH5451nW2esQR8XaAttT3tYJZEw1Nj3OEMgkHsMZrZDxhcRXHw@mail.gmail.com>
Hi Andrew,
The problem about that, is that if I want to delete the first repo, I will loose objects... Or does that repack also hard-link the objects in other repos? I don't want to accidentally loose data, so it would be nice that althought avoided to repack things, it would also hardlink them. Javier Domingo
2012/11/15 Andrew Ardill <andrew.ardill@gmail.com>:
Show 37 quoted lines
> On 15 November 2012 10:42, Javier Domingo <javierdo1@gmail.com> wrote: >> 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]: > >> 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