This page contains description of the Git-specific fields of the VCS root settings.
For common VCS Root properties, see this section.
Path to git
Provide the path to a git executable to be used on the agent. When set to
Clean Policy/Clean Files Policy
Specify here when the "git clean" command is to run on the agent, and which files are to be removed.
When enabled (default), TeamCity clones the repository under the agent's
TeamCity executes Git garbage collection until the total time doesn't exceed 60 minutes quota; the quota can be changed using the
teamcity.server.git.gc.quota.minutes internal property.
Git garbage collection is executed every night at 2 a.m., this can be changed by specifying the internal property with a cron expression like this:
"teamcity.git.cleanupCron=0 0 2 * * ?" (restart the server for the property to take effect)
If git gc process is slow and cannot be finished within allotted time, check git-repack configuration in the default git configuration files. e.g. "--window-memory" can be increased to improve git gc performance.
When Git gc is configured, TeamCity will run automatically in the background it for all currently monitored VCS roots. With large Git repositories, if git gc has not been performed for a long time, garbage collection may take significant time. Alternatively, you can stop TeamCity and delete the entire content of <TeamCity Data Directory>/system/caches/git directory to force fresh clones. If you do not want to do a fresh clone, you can stop TeamCity and run "git gc" manually for all the <git-XXX> git clones in the directory.
- java.lang.OutOfMemoryError while fetch repository. Usually occurs when there are large files in the repository. By default, TeamCity runs fetch in a separate process. To increase memory available to this process, change the teamcity.git.fetch.process.max.memory above). (see description of this property
- Teamcity run as a Windows service cannot access a network mapped drives, so you cannot work with git repositories located on such drives. To make this work, run TeamCity using teamcity-server.bat.
- inflation using streams in JGit prevents
OutOfMemoryError, but can be time-consuming (see the related thread at jgit-dev for details and the TW-14947 issue related to the problem). If you meet conditions similar to those described in the issue, try to increase
teamcity.git.stream.file.threshold.mb. Additionally, it is recommended to increase the overall amount of memory dedicated for TeamCity to prevent