title: How do I get TeamCity to automatically merge a Git feature branch with master and fail the build in case of merge conflicts?
body: <p>Our development/release cycle works like this:</p>
  
  <ol>
  <li>Developer creates a feature branch, implements a feature</li>
  <li>Developer indicates feature is ready for acceptance testing (UAT)</li>
  <li>Tester deploys feature branch and accepts (or rejects) feature</li>
  </ol>
  
  <p>Accepted features are then merged into the master branch <strong>by the tester</strong>, and will therefore be released during the next release cycle (we deploy the trunk/master code weekly).</p>
  
  <p>We're having frustrations with merge conflicts, because by the time the tester has UAT'ed the feature and discovered that it won't merge cleanly, the developer who worked in it has normally moved on to something else.</p>
  
  <p>We're considering a solution whereby every feature branch is automatically merged, by TeamCity, against the current master branch, and any build resulting in a merge conflict is considered a failed build - this will give us early visibility on problematic merges so we can fix them sooner.</p>
  
  <p>TeamCity doesn't appear to have built-in support for this workflow (i.e. when a push happens to branch X, checkout master, merge branch X onto it, build, unit-test, create package). Has anyone created a similar workflow using TeamCity and Github - using custom msbuild targets, perhaps?</p>
  
  <p><strong>EDIT:</strong> I should clarify that we're using Github but we're not currently using pull requests - sounds like this is something I should investigate. :)</p>