0

Hi StackOverflow Community. We have a ticket system connected to Bitbucket-Server in which we can click 'Create Branch'.

Ticket System - Create Branch

Then we go to the Bitbucket Server Site and we can choose repository, Branch type and so on.

Create Branch

I want to block building a New Master Branch and just to allow building New Feature Branch and set up Feature Branch as Default Option.

Branch Types

Question is how to do that? With a Bamboo Plan? I hope I could explain and it's not a big deal to enable that settings.

legoscia
  • 39,593
  • 22
  • 116
  • 167
  • 1
    What exactly do you mean by a "a *new* master branch"? If you already have a branch named master, you can't create a new one, and as far as I know, there's no concept of "master branches", plural. Can you be specific about what you want to prohibit? – Lasse V. Karlsen Sep 19 '19 at 13:06
  • I want to block creating a branch wit a new name. It's true you can't create a new 'Master' Branch, because the name is already taken. In our team we want from Jira Ticket System, by clicking create branch to actually create a feature. – Hubert Borys Kościński Sep 19 '19 at 13:11
  • Just to be clear, you want to prevent the developer from writing *his own* branch name? When you create a branch, it will always have to have "a new name", as you can't create two branches with the same name. Are you simply looking to make the branch name text field in the webpage read only? (simply, as in "simply stated", not as in "simply done") – Lasse V. Karlsen Sep 19 '19 at 13:19
  • "Master Branch" is not one of the bitbucket branch types, which is why you're getting such confused responses. True, it would be nice if people read the question before commenting, but you're still making yourself very unclear by using a term that means one thing as though it meant something else. I suggest you check the documentation (https://confluence.atlassian.com/bitbucketserver/using-branches-in-bitbucket-server-776639968.html#UsingbranchesinBitbucketServer-Branchtypes) - in particular I would think the sectino on configuring a repo's branching model might have your answer. – Mark Adelsberger Sep 19 '19 at 13:24
  • Hi @mark, you imply I did not read the question before commenting, and that was not the case, though I will agree that I did not understand the question. My point was that I see nowhere in the screenshots or text here that the user is trying to create anything called a "New Master Branch" other than the remark that OP wants to prevent it, hence my question. Basically, I still don't understand what OP is trying to prevent, I would very much like to know what kind of branch (concept) OP is trying to prevent here. – Lasse V. Karlsen Sep 19 '19 at 13:29
  • I guess my confusion stems from the fact that I don't know what **a** master branch is (in terms of there being several). I know what **the** master branch is (usually). – Lasse V. Karlsen Sep 19 '19 at 13:31
  • Yes, I want to prevent the developer from writing his own name. – Hubert Borys Kościński Sep 19 '19 at 13:35
  • Sory for confusing you guys. I'm new and still not getting all the names. Sometimes people are using his own names, when they're working together for very long time. – Hubert Borys Kościński Sep 19 '19 at 13:37
  • I would caution you against this. I don't know if Jira allows you to make that kind of configuration change, but this is probably better served by communicating with your developers about any issues their branch names causes. The reason I say this is that I assume you're not blocking them from editing the title of their issues, in which case preventing them from editing the branch names will likely cause them to be inventive when naming the issues in order to create the branch names they would like to use. In my opinion it would be better to talk to them about this, than to prevent it in UI. – Lasse V. Karlsen Sep 19 '19 at 13:45
  • 2
    If you use pull requests to merge to your main branches, a few declines due to bad branch names quickly cures them of this habit, has been my experience. – Lasse V. Karlsen Sep 19 '19 at 13:46
  • Even if you manage to prevent this via the web-interface, a developer can still create branches via the command line. IMO preventing the web-interface will just result in developers switching to the command line to bypass this limitation. My recommendation is to create a written set of guidelines for "acceptable branch names" (preferably with developer buy-in) and then have people stick to that. If developers aren't doing so, handle it like any other job performance concern. – Vlad274 Sep 19 '19 at 14:47
  • I have manage to lose my problem by installing an app from marketplace 'Control Freak' : https://bit-booster.com/hook/docs/#branch But still need to change the default branch to feature, because we in our team likes features branch. – Hubert Borys Kościński Sep 19 '19 at 15:40

0 Answers0