1. Bitbucket
  2. Public Issue Tracker
  3. master
  4. Issues

Issues

Issue #9368 open

Branches: set different default destination branch (BB-10403)

Ben Tatham
created an issue

It seems that in a given repository, there is only one "main" branch. This of course makes sense in most cases.

However, when we want to have a long running "legacy" branch, it would be nice to still be able to use gitflow on that. While Bitbucket does not support gitflow directly, it does tell you that your branch is out of sync with the repo's main branch (when looking at the /{repo name}/branch/{branch name} page).

It would be nice to be able to specify a different "main" branch for a given branch (including specifying none for the legacy "develop" branch, in gitflow parlance).

In our example, we have a regular "develop" branch (and master of course), and then the "feature/foo" branches under it.

For legacy, I created a legacy/develop, legacy/master and use standard gitflow branches under the legacy/ prefix. So in other words, I want to have no main branch for "legacy/develop" and specify the main branch on the "legacy/feature/*" branches.

Comments (83)

  1. Michael Frauenholtz staff

    Hi Ben,

    This is something that we considered when we added the branch list, but did not have time to implement. We have a ticket in our backlog for this. I don't know that we can get to it soon, but we'll let you know here when we've got more to share.

    Cheers,
    Michael

  2. Derek Price

    Yes, I think simply choosing the base branch as the default destination (instead of master) when creating pull requests would simplify things immensely for my team and help avoid a lot of human error.

    branch base.png pull destination.png

  3. Keith Starsmeare

    I'd like this option too. I'd also like it if I didn't have to google and guess to discover what happens if I change the "Main branch" in the Repository details configuration page. Please, at the very least, document the implications of changing that value!

  4. Allen Luce

    It's hard to support large-team workflows with the notion of a single main branch. It would be handy to support both a non-default upstream branch and NO main branch at all.

    I've a PR from an orphan branch targeting a new (non-main) branch on the upstream repo. The PR main view says "Nothing to merge. The source or destination branch was deleted or these changes already exist in the destination repository." This is despite the fact that the commits tab shows the work.

  5. Kyle Odell

    Totally agree here, this would be a huge improvement. Any time we have parallel projects going on, our intention is not immediately to merge to master, there is usually an epic branch with a few interrelated stories coming off of it.

    When clicking a branch from the Branches page, the diff always defaults to a comparison against master, it doesn't remember changes made to the destination dropdown.

  6. James Wallace

    I support this. Would really love the feature to let us save a bit of time when creating pull requests. Seems like it would be a relatively minor addition... but who knows.

    Anyway, would love to see it added!

  7. Steven Gosseling

    I would really like if this was implemented, this could help us to maintain the gitflow a lot easier, without constantly manually change the destination branch. Which is prone to human error...

  8. Adam Braman

    +1 definitely. Was really happy when I saw that you guys supported changing the target of a PR, something github still fails to do, but not being able to set a default branch is a greater fail.

  9. Matt McCutchen

    I filed a support request that the "change destination" link on the branch page is misleading (it looks persistent but actually only affects the current page) and was told that the misleadingness would not be addressed separately from the actual persistence requested by this issue report. Adding a comment to help the next person find this issue report.

  10. Dan Abrey

    I was totally confused by the "Change destination" link in the manner that Matt McCutchen mentions above, and came here looking for the behaviour suggested here. Big ol' +1 from me, would reduce a lot of human error.

  11. Alex Setska

    Having an option to set default destination of pull request to parent branch (instead of one branch for the entire repo) would be very much appreciated. (Derek Price's solution)

  12. Derek Price

    Yes, my team has been waiting for this for a year and a half. It seems to me like the solution I suggested above should be extremely easy to implement and it would be extremely useful to a lot of people.

  13. Glyn Jones

    This issue really complicates having feature branches off a main branch. Ideally when developing bigger features you branch off main and then do multiple branches off the feature branch with pull reqs into the feature branch. C'mon guys, get this fixed!

  14. Oliver Polden

    Yes I agree. Normal process is to branch off master, pull request into a develop or feature branch. Then once tested to merge back into master. Being unable to set the main branch separate to the default pull request branch easily means that either people branch off the wrong branch, or pull request into the wrong branch. It's a major issue that could result in code being deployed that shouldn't be.

  15. SkyKickJenkins

    We ended up re-naming our "develop" branch to "master" and our "master" branch to "develop". It's confusing for newer (and sometimes old) employees, but hey, at least you don't have to select a different destination branch!

  16. Log in to comment