Git fetch depth

I have a large Git repo (cloning creates a 20Gig .git dir). I can substantially reduce this size by using a shallow clone and fetch, which should be good since I'd only need recent changes for tracking. It doesn't look like the Git plugin supports this - correct? Any suggestions, or is customizing the plugin to add some options a worthwhile idea?

0
2 comments
Avatar
Permanently deleted user

Hi,

Set the following variables in your build to perform shallow clone

teamcity.git.use.local.mirrors = true and teamcity.git.use.shallow.clone = true

however, if you tick the "mirror" option in your VCS root, you will not need to use these variables and the effect is even more efficient then shallow clone.

Both options store a local bare repository on the agent, using shallow clone uses git clone --depth=1 from the mirror 

The "mirror" option uses git alternates, which is some trickery where the checkout repo actually points to the mirror directly (and is therefore very small)

Regards

-1

Doesn't matter what I do.

 

teamcity.git.use.local.mirrors = true and teamcity.git.use.shallow.clone = true

 

These settings do absolutely nothing as far as I can tell.

0

Please sign in to leave a comment.