4

I have a pull request on GitHub to merge branch foo into develop (my default branch). I do have a branch master but this is not the branch I want to merge into.

In TeamCity, in VCS roots for my project I have the following setup:

  • Default Branch: develop
  • Branch Specification: +:refs/pull/*/merge

I have published a pull request, but when TeamCity builds the PR it merges foo with master (not develop).

James Monger
  • 10,181
  • 7
  • 62
  • 98
  • Please check the AutoMerge build feature settings, it specifies the target branch for merge. If you don't use it and merge inside a build script, then check the script logic. – neverov Oct 24 '17 at 13:54
  • 1
    This looks quite similar to this other question: https://stackoverflow.com/questions/46890527/teamcity-always-merges-into-master. The TeamCIty feature request linked in one of the answers there (https://youtrack.jetbrains.com/issue/TW-43759) is probably what you need; if that was implemented, you'd be able to access the merge's target branch in the TeamCity VCS roots. If you want that feature, the best thing to do right now is to go to JetBrain's bug tracker and vote for it, so that it moves up on their priority list and they work on it sooner. – rmunn Apr 02 '18 at 13:04
  • @rmunn I think the question you've linked is this question... – James Monger Apr 03 '18 at 09:15
  • 1
    @JamesMonger - Whoops! Thanks for the catch; I meant to link https://stackoverflow.com/questions/32483842/build-pull-requests-to-specific-branch-using-teamcity-and-github, which mentions https://youtrack.jetbrains.com/issue/TW-43759 in one of its answers. – rmunn Apr 03 '18 at 09:25
  • Thanks @rmunn - I've voted to close this as a duplicate – James Monger Apr 03 '18 at 09:26

0 Answers0