Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Everyone Can Merge to Master & Development

Nick P June 27, 2019

Hi everyone,

I am really struggling with branch permission setup.

I set the below permissions up for all repo's in our company. I was told by devs that this would 1. make sure no one can write direct to develop branch (our main branch) and 2. make sure every merge attempt required at least 1 approval.

What I found today was that my team has found a way around this - they make a new branch (which is fine) - let's call it "test-branch-1". This new branch doesn't have any permissions. They then create a pull request and are able to click "merge" without actually adding a reviewer.

branch.JPG

My ideal state is that everyone can review each other's code, but no one should be able to merge to master OR develop without 1 approval.

Any help would be appreciated. I'm relatively new to git management.

1 answer

1 accepted

1 vote
Answer accepted
Mikael Sandberg
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
June 27, 2019

Hi @Nick P,

Branch permissions does not control when a pull request can be merged. In order to not allow users to create a pull request and then click the merge button right away, add the Check for at least 1 approval.

Branch permissions.png 

You also need the Premium option Prevent a merge with unresolved merge checks. 

Nick P June 27, 2019

Hi @Mikael Sandberg 

TY for the response.

I should have specified, I definitely have this box ticked for all my branch permissions, however it doesn't seem to enforce this rule if the person falls under the "Everybody" category to merge.

Mikael Sandberg
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
June 27, 2019

Do you also have the premium option checked? Without it all the Check for at least X approval will do is notify you that the pull request has not been approved, but it will not prevent the merge from happening.

Nick P June 27, 2019

@Mikael Sandberg  - here is a screenshot of my setup for each "Development" branch permission.

branch2.JPG

Nick P June 27, 2019

@Mikael Sandberg boom, there it is. The premium feature is what we're missing.

Like Mikael Sandberg likes this

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events