How to specify Target branch in VCS root?

How can I configure my VCS root to only trigger when a specific target branch is specified? For instance my current branch specification is defined as `+:refs/(merge-requests/*)` but I would also like it to only trigger when the target is `develop`.

I noticed that TeamCity now supports specifying the target branch in a VCS root per this YouTrack item but I wasn't able to find documentation about how to use this feature when configuring a VCS root.

1
1 comment

Hi Myles,

 

VCS Roots and triggers are two separate entities. VCS Roots define how TeamCity tracks changes on a repository. Triggers define when (and how) a build should be triggered. Importantly, VCS Triggers can only trigger on branches that are being tracked (as TeamCity doesn't have knowledge about non-tracked branches).

 

In your case, you should add develop to your branch specification (or make it the default branch), then make the VCS Trigger use the branch filter "+:develop" (or refs/heads/develop). That should make builds only trigger on changes on that specific branch.

 

More information on vcs triggers here: https://www.jetbrains.com/help/teamcity/configuring-vcs-triggers.html

0

Please sign in to leave a comment.