How to tell TeamCity to treat merges as a single commit when working with git? How to tell TeamCity to treat merges as a single commit when working with git? git git

How to tell TeamCity to treat merges as a single commit when working with git?


I'm pretty sure this is the same issue that we had a few days ago, but vice-versa. We merged a dev branch into master, which caused TC to attempt to build each and every check-in that was part of the merge. Obviously not what we wanted.

To fix it, keep the Trigger build on each check-in option unchecked in the Build Trigger.

You get the full change history from the source branch, but TeamCity will only build the destination branch using the latest merged code. If that build fails, the merger should be the only one notified.


This is a long shot, and you've probably already tried it, but might it work to apply the per check-in trigger option to Include several check-ins in build if they are from the same committer? This might be enough to trick TC into building the commits as a single bundle.


These are two possible solutions:

  1. One way to solve this (though possibly very awkward, depending on your situation) is to notify users on the level of a build configuration as opposed to notifying who committed/was merged. Create separate build configurations for different topic branches and configure notification per build configuration so that only the 'owner' of the topic branch is notified.

  2. Less sure, but worth a try: You could configure notification per topic branch(es), e.g. by wildcard patterns on the branch path. This should be possible by means of a DYI custom notifier plug-in that uses e.g. the branch name property, teamcity.build.vcs.branch.<my_vcs_name>.

A specific limitation of TeamCity email notification (it should be easy to support) is that you can not filter notifications by a combination of build configuration and 'Ignore failures not caused by my changes'. Then at least you could configure the build for the main branch so that committers are notified, and create specific settings only for the topic branch projects.