How can we improve Azure DevOps?

Change Pull Request Target Branch

It would be great to be able to change the target branch of a pull request. Sometimes a pull request is simply opened against the wrong branch. Other times, the comments and discussion resolve in wishing to integrate with a different branch prior to promoting to the original target.

411 votes
Sign in
Check!
(thinking…)
Reset
or sign in with
  • facebook
  • google
    Password icon
    Signed in as (Sign out)

    We’ll send you updates on this idea

    Maxwell Bloch shared this idea  ·   ·  Flag idea as inappropriate…  ·  Admin →

    36 comments

    Sign in
    Check!
    (thinking…)
    Reset
    or sign in with
    • facebook
    • google
      Password icon
      Signed in as (Sign out)
      Submitting...
      • Curt Safranek commented  ·   ·  Flag as inappropriate

        There appears to be no validation when completing a PR and merging the PR's branch to the selected target branch. I had 3 PRs with 3 separate branches, with each PR subsequent to the 1st having its target branch set to the previous. The PRs were approved and I began completing them, with the merge and having the PR's branch deleted upon completion. Each PR closing completed without issue, showing no errors or issues. However, with the 2nd and 3rd PR's target branches no longer present/valid, the completion of these 2, having non-existent target branches, happily and silently removed every single change in the PRs branch.

        Obviously these PR's target branches should have been set/reset before closing them, but I expect VSTS to have not allowed/closed the PR given the PR's target branch did not exist!

        Hopefully this will be fixed quickly! In the interim - WARNING TO ALL WHO USE THIS FEATURE - make sure your PR's target branch is correct before completing the PR!!

      • Alejandro Barreto commented  ·   ·  Flag as inappropriate

        @Bouke: It may not have been deployed to your instance yet (it is on mine). There's a note on the release notes that states: "These features will be rolling out over the next two to three weeks."

        Overall, I wish Microsoft would also notify us the actual moment new features roll out on our account. I love the release notes, but sometimes (like for this item!) I get really excited to try it out but then I realize I have to wait a few days.

        By the way, retargetting PRs is the *AWESOME*. We're already using it quite a bit. Thanks!!!

      • Bouke Haarsma commented  ·   ·  Flag as inappropriate

        @Thedor, the pencil icon is not yet shown on our instance of DevOps. Not sure what's needed to make that happen, but as-is this item should not be closed.

      • Anonymous commented  ·   ·  Flag as inappropriate

        I'm happy that this will be implemented. Will it also be possible to update/rebase PR on current target branch?

        A workaround (ex PR on target branch "target-branch") would be to:
        1. create a new branch identical to target branch "target-branch2"
        2. Change Pull Request Target Branch to "target-branch2"
        3. Change Pull Request Target Branch back to "target-branch"

        But that would be tedious, so please consider this use case as well.. :)

      • Anonymous commented  ·   ·  Flag as inappropriate

        There was people cheering in the office when they got the notification about this having started / being scheduled for Q3. Thanks.

      • Y.S commented  ·   ·  Flag as inappropriate

        This is great!! Many instances we needed to change the target branch.

        It would be nice to be able to view different repositories in a single view

      • Greg L. Wright (3M) commented  ·   ·  Flag as inappropriate

        +1 bump, for us this goes many ways, by mistake, but more typically, by having to put a private branch (review) onto a feature branch, or more.

      • Albert Stimson commented  ·   ·  Flag as inappropriate

        This is part of our basic workflow, not just needed when a dev makes a mistake. When a pull request misses a deadline for a code freeze, it generally needs to target a different branch. Redoing all of the documentation, comments, and attached work items after abandoning the pull request is not ideal.

      • Benjamin Gare commented  ·   ·  Flag as inappropriate

        Can we get a target date for this? I have to change the target branch OFTEN in my daily work since some Pull Requests have a longer review process.

      • James Chorlton commented  ·   ·  Flag as inappropriate

        Any news on this Microsoft? Found my way here whilst googling how to do it in VSTS, not a great thing that the top google result tells you that you cant do it.

      • Lee Richardson commented  ·   ·  Flag as inappropriate

        Wait, so if I have stacked PR's I have to delete and resubmit downstream PR's when an upstream one gets merged?! All the comments and dialog gets deleted?! I just moved from github and assumed this was a standard feature. And this has been a feature request for 2 years?! Poorly done VSTS.

      ← Previous 1

      Feedback and Knowledge Base