A Version Control System (VCS) is a system for tracking the revisions of the project source files. It is also known as SCM (source code management) or a revision control system. The following VCSs are supported by TeamCity out-of-the-box: Git, Subversion, Mercurial, Perforce, Team Foundation Server, CVS, StarTeam, ClearCase, SourceGear Vault, Visual SourceSafe.
Connection to a version control system is defined with a TeamCity VCS root. A build configuration in TeamCity can have one or more VCS roots attached and also defines other checkout options like Checkout Rules. These define the workspace for the build.
TeamCity always monitors the repositories from the server-side to detect changes and display them in UI. Depending on the specified VCS Checkout Mode the actual repository checkout can also happen on the agent-side.
TeamCity performs VCS-related operations per each VCS root separately, thus it is advised to reuse VCS roots with same settings.
When parameter references are used in the VCS root, TeamCity performs VCS-related operations per each "VCS root instance", where "instance" is a unique set of VCS root parameters after references resolution. Adding parameters into the VCS roots does not reduce the number of VCS operations performed, it just allows to share settings more effectively.
Typical VCS settings configuration occurs on the 2nd page of the build configuration (Version Control Settings page) and consists of the following :
- Attach an existing VCS root to your build configuration, or create a new one to be attached. This is the main part of VCS parameters setup; a VCS Root is a description of a version control system where project sources are located. Learn more about VCS Roots and configuration details here.
- When several VCS roots are attached or you need to checkout only a portion of the repository, specify the checkout rules for the VCS root — specifying checkout rules provides advanced possibilities to control sources checkout. With the rules you can exclude and/or map paths to a different location on the Build Agent during checkout.
- Define how project sources reach an agent via VCS Checkout Mode.
- Configure VCS trigger if you want the build to be started on new changes detection.
- Additionally, you can add a label into the version control system for the sources used for a particular build by means of VCS Labeling build feature.