Every branch is shown twice with "refs/heads/"-Prefix and without - only prefixed ones are triggered automatically. Follow
Teamcity shows almost every branch in my build configuration twice. Once with a "refs/heads"-Prefix, once without. Unfortunately some branches (no pattern detected so far) are only available without the prefix. Additionally, while all refs/heads/* Branches are triggered as expected, the ones without need to be triggered manually the first time. After that they are triggered automatically.
All my branch specifications use "+:*" to detect branches. Why does TC show those branches in two different ways and why is only the one pattern triggering the Build? I would like to handle only one pattern, plus make sure I don't miss branches when I simply filter out branches without the prefix.
Trigger:
Branch specification and filter in VCS root:
Please sign in to leave a comment.
You can find out more about the logical branch name here: https://www.jetbrains.com/help/teamcity/working-with-feature-branches.html#Logical+branch+name
Hey, Anatoly Cherenkov. Thanks for your quick reply. Unfortunately, this is not the case. Also branches created after the last changes are recognized once with - and once without the /refs/heads prefix and the branch without prefix collects pending changes. I have attached a screenshot showing such a branch. Do you have any ideas how to solve the problem or why Teamcity displays the branches twice in the first place?
Another possibility is if two VCS roots that are pointed to the same repo but have different branch specifications are attached to the build configuration.
Also, according to the VCS root settings screenshot and branch filter screenshot, the settings don't seem entirely correct. The VCS root settings work with branch refs like "refs/heads/master", while the branch filter works with logical branch names like "master". You check the difference here: https://www.jetbrains.com/help/teamcity/working-with-feature-branches.html#Logical+branch+name
It looks like the default branch in your case should be:
refs/heads/master
The branch specification should be something like this:
+:refs/heads/*
-:refs/heads/develop-integration
-:refs/heads/master
That would result in the logical branch names (the ones you see in the branch dropdown on the build configuration overview page) not having the "refs/heads/" prefix.
And the branch filters should be something like this (use the magic wand icon to pick the desired logical names from the UI to minimize the human error):
+:*
-:master
Thanks, Anatoly Cherenkov. We indeed confused Syntax for branch specification and filters. Using the appropriate Syntax helped. Still it would have been useful to become some kind of error message instead of a not correctly but somehow working setup due to wrong Syntax. Thanks for your help!