Better Git VCS


We're using latest at the moment, 6.0.2, TeamCity build without built-in Git plugin, but with a NANT target that performs the following:

  1. Checks whether user setup GITFOLDER environment variable and passed git.repositories.folder variable. GITFOLDER must point to a folder where git.exe resides. git.repositories.folder variable must point to a folder, which contains folders with Git repositories. Repositories folder must be different from agent's checkout directory because we must clean build's working folder.
  2. If there is no folder of a project inside git.repositories.folder folder, then we perform git clone <url> "git.repositories.folder\projectname", which will take some time. This operation happens only once.
  3. Executes git pull  git.repositories.folde folder\projectname
  4. Copies all files to the build agent's working folder
  5. Starts a build

the question is - is it possible to have such functionality built into TeamCity ?


Comment actions Permalink

Hi Alex,
as I understand you want to do a clean checkout but do not want to loose a '.git' of your repository. We addressed this problem in the last 6.5 EAP: you can set agent property teamcity.git.use.local.mirrors=true to activate it. When it is set to true we clone git repositories to separate folder and clone to working dir from this local mirror, so clean checkout should be fast. Please see for details. This feature is not yet supported for submodules, there is a issue you can watch/vote for (

Comment actions Permalink

We installed 6.0.3 and removed built-in GIT plugin. Then we took GIT plugin from the latest 6.5 EAP and now we can use new GIT VCS.
Shall we still toggle "teamcity.git.use.local.mirrors=true" switch manually?

Comment actions Permalink

yes, it is turned off by default, because it requires some additional space on agents


Please sign in to leave a comment.