Managing Large Repos

Article by:
Date Published:
Last Modified:


The size of a repository can grow in two orthogonal directions:

  1. The size of the history
  2. The size of the current repo data

Obviously, if a shallow copy has not been performed, the size of the history is always equal or greater than the size of the current repo data (assuming no compression has taken place, and the repo has no uncommitted changes).

Shallow Clones

Git allows a shallow copy, keeping only the latest n commits, with the command:

$ git clone --depth n

Git version 1.9 improved the capabilities of shallow clones dramatically, giving them full push/pull support between the shallow copy repo and a repo with the entire history.

As of 2015-01, Mercurial does not support this feature.


Geoffrey Hunter

Dude making stuff.

Creative Commons License
This work is licensed under a Creative Commons Attribution 4.0 International License .

Related Content


comments powered by Disqus