Teamcity 9.1.5 build config built wrong branch

The project has a git vcs repo.

Default branch is : %PortalDefaultBranch% (which value is 'develop')

Branch spec is:


Each 'active branch' in repo has its own 'run' button. In my case I clicked the 'run' button under 'refs/heads/master' branch. The build was triggered, but the source code was fetched from develop. 2 minutes later i ran a custom build and changed parameter PortalDefaultBranch to refs/heads/develop and the build went through as planned, and the name of the package was correct.

Can not this 'run' button on each branch be trusted? Do I always have to change the DefaultBranch parameter?

Comment actions Permalink


Please try the following branch spec:


and also specify %PortalDefaultBranch% as "refs/heads/develop". Please let me know if it helps.

Comment actions Permalink

thanks for the quick response, but that didn't work. I pushed the 'run' button under 'refs/heads/master' branch, and still it built an 'unstable' package which tells me that it fetches from the wrong branch. (we use gitversion).

maybe it's some kind of cache that I must clear?

Comment actions Permalink

Hi Martin,

Could you please create a copy of the build configuration and try to start builds (use Actions > Copy configuration...)? Do they start on correct branches?


Please sign in to leave a comment.