简体   繁体   English

从svn切换到git时,构建服务器上的磁盘空间

[英]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. 目前,我们运行一个构建服务器,该服务器从SVN中检出项目,使用Maven进行构建,将其部署并在SVN中进行标记。 The project directories (checked out code and results of the last build) sum up to about 500GB. 项目目录(检出的代码和上次构建的结果)总计约500GB。

I wonder whether we need a lot more when using git. 我想知道使用git时是否需要更多资源。 If I understand this correctly, git does not only check out a copy of the "last version", but copies the complete history. 如果我正确理解这一点,git不仅会签出“最新版本”的副本,还会复制完整的历史记录。 So after a while, our build server will hold a complete copy of all git repositories. 因此,过一会儿,我们的构建服务器将保存所有git存储库的完整副本。

Is this correct? 这个对吗? Or am I mistaken? 还是我弄错了?

By default git clones the entire history. 默认情况下, git克隆整个历史记录。 But it's quite configurable.You can do shallow clone with git clone --depth=N , ie clone only a few latest commits. 但这是相当可配置的。您可以使用git clone --depth=N进行浅层克隆 ,即仅克隆一些最新的提交。 Public commercial CI/CD services usually do --depth=50 to be on the safe side but you can experiment with lesser depth. 为了安全起见,公共商业CI / CD服务通常这样做--depth=50 ,但是您可以尝试使用更小的深度。 For many projects --depth=1 is enough. 对于许多项目,-- --depth=1就足够了。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM