TeamCity On-Premises
 
Get TeamCity On-Premises
You are viewing the documentation for an earlier version of TeamCity On-Premises.

VCS Checkout Rules

Edit page Last modified: 08 February 2022

VCS checkout rules allow you to check out a part of the configured VCS root and to map directories from the version control to subdirectories in the build checkout directory on a build agent. Thus, you can define a VCS root for the entire repository and instruct each build configuration to check out only the relevant part of it.

The checkout rules affect what build changes are displayed in the UI and what files are checked out for a build on the agent. If a commit does not match any of the checkout rule patterns of the build's VCS root, TeamCity will completely ignore it. Such change will not be displayed as pending and will not be able to trigger any builds in the current configuration.
To display changes but not to trigger a build on a commit, use VCS trigger rules.

The general recommendation is to keep a number of VCS roots, pointing to the root of the repository, as small as possible and define what is checked out by a specific build configuration via checkout rules.

To add a checkout rule, go to the build configuration's Version Control Settings page, locate the VCS root in the list, and click Edit checkout rules to open a form for entering the rules. Use the VCS repository browser VCS-browserIcon.png to select a directory to check out.

Note that Perforce support in TeamCity treats checkout rules as case-sensitive. Case-insensitivity for Perforce-based build configurations can be enabled on the Version Control Settings page by adding the following comment in the Edit Checkout Rules form: ##teamcity ignore-case.