gitmavenjenkinssvnbuild-server

disk space on build server when switching from svn to git


At the moment, we run a build server that checks out projects from SVN, builds them with Maven, deploys them and tags them in SVN. The project directories (checked out code and results of the last build) sum up to about 500GB.

I wonder whether we need a lot more when using git. If I understand this correctly, git does not only check out a copy of the "last version", but copies the complete history. So after a while, our build server will hold a complete copy of all git repositories.

Is this correct? Or am I mistaken?


Solution

  • By default git clones the entire history. But it's quite configurable.You can do shallow clone with git clone --depth=N, i.e. clone only a few latest commits. Public commercial CI/CD services usually do --depth=50 to be on the safe side but you can experiment with lesser depth. For many projects --depth=1 is enough.