[FieldTrip] git repo quite big. How to save space?

Alday, Phillip Phillip.Alday at mpi.nl
Mon Jul 16 08:59:22 CEST 2018


There are a few things you can do:

1. Garbage collection and re-packing to get git to re-organize itself
into a more compact layout :

git gc --aggressive

If that takes too long, do it without --aggressive : it will be much
faster although potentially not as effective.

2. Use shallow clones (i.e. ones missing older history).

3. Clone from one local copy to another -- if the clones are on the same
file system, then git will use hard links and git objects common to both
repositories will be "shared" and only take up space equal to one
instance. Note that garbage collection, re-packing, etc. can break this
and lead to each clone having its own copies.

4. Don't keep a copy of FieldTrip in each project and start using paths,
version management, etc. more effectively. You definitely should know
which version of the software you used for a given analysis for
reproducibility/replicability, but there are more efficient ways to do
that than keeping a local copy. This is not meant to be harsh, but just
trying to address a potential "XY problem"
(https://meta.stackexchange.com/questions/66377/what-is-the-xy-problem).

Best,
Phillip

Date: Fri, 13 Jul 2018 18:20:21 +0200
> From: Maximilien Chaumon <maximilien.chaumon at gmail.com>
> To: FieldTrip discussion list <fieldtrip at science.ru.nl>
> Subject: [FieldTrip] git repo quite big. How to save space?
> Message-ID:
> 	<CAFU3-hGBMUgCgmcgZbjGronss1RTuCbQZ=z-gDeoW=y9m8dj6w at mail.gmail.com>
> Content-Type: text/plain; charset="utf-8"
>
> Dear all,
>
> I have several copies of FieldTrip for several projects shared with others.
> Each has its own copy of FieldTrip, which is at the moment a 1.7GB folder,
> of which 1GB is taken by the .git directory. Would there be an easy way to
> prune the repository where needed?
>
> Best,
> Max
>





More information about the fieldtrip mailing list