TeamCity Cloud 2024.12 Help

Configuring VCS Roots

A VCS root in TeamCity defines a connection to a version control system. It represents a set of parameters (paths to sources, username, password, and other settings) that determine how TeamCity communicates with a VCS to monitor changes and get sources for a build.

VCS roots are created in a project and are available to all the build configurations defined in that project or its subprojects. One or more VCS roots can be attached to a build configuration or a template. You can specify portions of the repository to check out and target paths via VCS checkout rules.

To view and manage all VCS roots configured within a project, go to Project Settings | VCS Roots.

Here, you can filter the project's roots by name and modify other filter options.

If someone attempts to modify a VCS root that is used in more than one project or build configuration, TeamCity will issue a warning that the changes to the VCS root could potentially affect other projects or build configurations. The user is then prompted to either save the changes and apply them to all the affected projects and build configurations, or to make a copy of the VCS root to be used by a specific build configuration or project.

On an attempt to create a new VCS root, TeamCity checks whether there are other VCS roots accessible in this project with similar settings. If such VCS roots exist, TeamCity suggests using them.

Once a VCS root is configured, TeamCity regularly queries the version control system for new changes and displays the changes in the build configurations that have the root attached. You can set up your build configuration to trigger a new build each time TeamCity detects changes in any of the build configuration's VCS roots, which suits most cases. When a build starts, TeamCity gets the changed files from the version control and applies the changes to the Build Checkout Directory.

Common VCS Root Properties

Property

Description

Type of VCS

Type of version control system supported by TeamCity: for example, Perforce or Subversion.

VCS root name

Unique name of VCS root across all VCS roots of the project.

VCS root ID

Unique ID of VCS root across all VCS roots in the system. VCS root ID can be used in parameter references to VCS root parameters and REST API. If not specified, will be generated automatically from VCS root parameters.

Repository URL

URL to VCS repository. Supports URLs in different formats, like: http(s)://, svn://, ssh://git@, git:// and others as well as URLs in Maven format.

Minimum polling interval

Specifies how often TeamCity polls the VCS repository for VCS changes. By default, the global predefined server setting is used that can be modified on the Administration | Global Settings page. The interval time starts as soon as the last poll is finished on the per-VCS root basis. Here you can specify a custom interval for the current VCS root.

If TeamCity detects that a VCS commit hook is used to trigger checking for changes, this interval is automatically increased up to the predefined value (4 hours). If the periodical check finds changes undetected via the commit hook, the polling interval is reset to the specified minimum.

Belongs to project

Each VCS root belongs to some project, and in this section the name of this project is displayed. A VCS root can be moved to the common parent project of all subprojects, build configurations and templates where the root is currently used.

Refer to the pages inside this section for VCS-specific configuration details.

Last modified: 03 November 2024