Branch specification and tagging

We use Git with TeamCity 8.0, and we use branching. Branches are:

feature-baz (etc.)

We also want to use tags, e.g.,


I've tried so many times to set the branch specification to make this work, but I keep getting the wrong behavior. Previously, I had:


With my default branch set to "master". This mostly worked, except:

1. I commit to master
2. TC builds master
3. TC tags the build
4. TC builds my tag!

So every push to master would result in two builds - one for master, and one for the tag.

So I tried to be more specific:


But TC is still building my tags, and I can see two branches "master" and "refs/heads/master" which shows as my default.

How do I tell TC to build my braches without building my tags?

Comment actions Permalink

If you can distinguish commits that are moving tags somehow you can exclude them using trigger rules in VCS trigger:

Comment actions Permalink

Hi Paul,

First of all, thanks for Octopus.

I'm not sure I quite understand fully. Is it that you want to be able to build from master, branches and tags, however you don't want to trigger a build on a tag if one is in the queue for master? Or do you not want to build from tags at all?

Is "Use tags as branches" ticked in your VCS configuration?

have you tried -:refs/tags/* in your branch specification or VCS trigger?

Comment actions Permalink

Thanks for the response. I've tried what you suggested; this is what my branch spec looks like in the VCS settings:



And this is what my branch filter looks like in the VCS trigger:





However it was still building all tags. Then I disabled the GitHub TeamCity webhook and the problem went away. The webhook doesn't appear to support wildcards so I didn't enter anything in the branch field, so it was notifying for tags too.


Please sign in to leave a comment.