Does Automatic Merge work on a merged branch like a Pull Request?


If I am running a DMZ flow for our git how do I ensure that team city runs tests on a merge of dmz branch into master branch BEFORE committing the dmz branch changes to master. In the overview of Automatic Merge it seems like the tests will run on dmz and if they pass it will merge the dmz changes to master. 

How do I make sure the tests run on a merged version of dmz and master before committing the changes to master?

Comment actions Permalink

I want to trigger on dmz, checkout master, merge dmz into master, run my tests on that merge and then commit the dmz changes to master. Do I need to perform that checkout + merge in command line?

Comment actions Permalink

Hi David,

Currently it's not supported. Please vote for the request:

The current workaround is to use agent-side checkout and to perform merge via command line.


Comment actions Permalink

A follow up question to this, is it possible to write a plugin that would handle the pre-build merge instead of using the command line? If so, where should I start looking?

To elaborate:

We have a similar situation as the OP, but in our case we have 3 related projects  (application A, configurator B, test framework C) with the same branching setup, which are gathered together in a nightly attempt to merge their respective development branches to their master branches. The dev branches of these are built on commit, but for the test run I'll have to make a special "integration build" which does the pre-build merge, so I get the proper binaries to use in the actual test run.

Currently this means that I'd have to maintain 2 different builds, where one of them has this pre-build merge script and the automatic merge.

Ideally I'd like the build history to show that a build is indeed an "integration build": instead of showing "refs/heads/develop" as the built branch, it'd show something like "refs/heads/develop applied on top of refs/heads/master", since that is the actual case.

Any pointers?

Comment actions Permalink

Hi Sami,

I think you can write a build feature which does merge before the first build step. I'm not sure if developing such a build feature worth it. In my opinion there is not much difference between adding an additional build step and adding a build feature. To me an additional build step is probably a more obvious setup.

Maybe the following setup can help in your case. Create an additional 'integration' branch in each repository, configure auto-merge from feature branches into 'integration' and from 'integration' into master. Every night TC can build development branch and try to merge it into 'integration' if the build is successful. After that it will detect new commits in 'integration', run build there, and if it is successful merge it to master. This way master gets only tested commits.


Please sign in to leave a comment.