Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Excluding files from branch permissions

Martin
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
January 21, 2022

Hi! We are using the branch permission settings on our repository to prevent changes without a pull request to the master branch. What we would need is to exclude certain files from this permission.

Let's say my repository contains FileA, FileB and FileC. Now I want to allow changes on FileC to be pushed to the master branch without a pull request, so I want to exclude this file from the branch permission. If I need to push changes on FileA or FileB, the branch permission should prevent the direct commit to the master.

Is this somehow possible on Bitbucket Server v7.6.12?

1 answer

0 votes
Pramodh M
Community Champion
January 21, 2022

Hi @Martin 

Welcome to the Community!!

Straight forward there are no plugins that achieve this functionality!!

We would need to check the filenames as well while merging the code which is not an efficient way when we take this to more repos context.

You can go configure with branch protection rules that bitbucket offers and leverage those to have your flow apart from the file permissions requirement

Thanks,
Pramodh

Martin
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
January 25, 2022

Hi @Pramodh M

thanks for your answer!

Is there probably a feature / plugin available to auto-approve pull requests if a certain criteria is met?

For example when we stick to the example which I mentioned above with the 3 files (fileA, fileB and fileC): I could imagine that I have to open a pull request if any of those files change, but an auto-approval is done when the commit contains fileC (depending on the rule I configured).

Would that be possible? With a quick search I couldn't find a plugin like that, so probably not?

Best wishes,
Martin

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events