How to store git repos of abandoned projects


I have over 200 projects on my workstation, every one is a git repository. Most of them are superseded or otherwise abandoned. I still keep the code in case I ever need anything from them.

Currently, the active projects are non-bare git repositories in ~/Projects, the inactive projects are .tar.gz archives that simply contain the whole non-bare git repository within the same folder. So I got the following:

  • ~/Projects/some-active/.git
  • ~/Projects/some-inactive.tar.gz

The advantage of this is that backups are really fast, inactive projects are just a single file which has to be checked/copied. Whenever I want to look into the projects, I have to extract the folder, look into it and compress it some time later when I think the project is inactive again.

Is there a better way to this?

Best Answer

First suggestion: Just keep them the same way as active repositories, except make sure all objects are in a single packfile (git gc will do that). rsync mostly just checks modification times; it doesn't read the whole file if everything else matches; it shouldn't be slow. (My backup consists of rsyncing over 1M files, many of which are Git repositories, and it's still acceptably fast...)

Second suggestion: Keep them as bare repositories. Whenever you want to look at the files, use tig's "tree browser" mode, or clone to /tmp (e.g. git clone -s ~/Projects/foo.git /tmp/foo). This way, each repo will have only about 5 files (packfile, pack index, config, packed-refs).

Related Question