Icon

You are viewing the documentation of TeamCity 9.x, which is not the most recently released version of TeamCity.
View this page in the latest documentation or refer to the listing to choose the documentation corresponding to your TeamCity version.

 

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: related to https://youtrack.jetbrains.com/issue/TW-51478

...


The use of * wildcard matches branches and extracts the branch name to be displayed in the TeamCity interface (also known as logical branch name):
For a Git VCS root, +:refs/heads/* will match refs/heads/feature1 branch, but in the TeamCity interface you'll see feature1 only as a branch name.

...

A logical branch name is a branch name shown in the user interface for the builds and on build configuration level. A logical branch name can be a part of the full VCS branch name. It is calculated by applying a branch specification to the branch name from the version control.

...

then the part matched by * (e.g. master ) is a logical branch name.

For the default branch,  <default> can be used, e.g.:

Code Block
+:<default>

 


If the branch specification pattern uses parentheses, the logical name then is made up of the part of the name within the parentheses; e.g. the branch specification +:refs/heads/(v8.1/*) will give you to see the v8.1/feature1 logical name displayed in the UI for the VCS branch refs/heads/v8.1/feature1, use this:

Code Block
+:refs/heads/(v8.1/*)

 

Builds

Builds from branches are easily recognizable in the TeamCity UI, because they are marked with a special label:

You can also filter history by a branch name if you're interested in a particular branch.
TeamCity assigns a branch label to the builds from the default branch too.

...

If a build configuration with branches has snapshot dependencies on other build configurations with branches, then when a build in a branch is triggered, the other builds in the chain will also get the branch associated, if the branches in the VCS roots of the builds have the same logical name and this branch is not excluded by the branch specification. The VCS roots of the builds can point to different repositories, but the logical branch name must be the same. 

...

The VCS trigger groups branches from several VCS roots by logical branch names. When some root does not have a branch from the other root, its default branch is used. For example, you have 2 VCS roots, both have the default branch refs/heads/master, the first root has the branch specification refs/heads/7.1/* and changes in branches refs/heads/7.1/feature1 and refs/heads/7.1/feature2, the second root has the specification refs/heads/devel/* and changes in branch refs/heads/devel/feature1. In this case VCS trigger runs 3 builds with revisions from following branches combinations:

...

Clean-up rules are applied independently to each active branch.

Manual branch merging

You can merge branches in TeamCity manually, e.g. if you want to merge branches only after a code review / approval, or if you want to perform the merge despite the tests failure in a branch.

...