Block merge from master branch

Hey there,

thanks for gitea. It is a great tool.

We have feature branches that are derived from master. We do port back fixes into master but we never merge master into a feature branch. Today a developer did exactly this and I would like to ask if it is possible to disallow this by using branch protection or something similar.

So I don’t to disallow merging in general (we already use branch protection for this) but I would like to forbid merging from master for all users except owners.

Regards
Christian

2 Likes

I don’t think this is possible. I’m however curious about why merging master into a feature branch created a problem.

Hi,

sorry you are right. This is no problem with feature branches. But it is a problem with release Branches. We don’t want to have any new Features from master in there.

Regards

1 Like

@crapp Anything in the meantime you configured to stop this from happening? We are dealing with the same issue.

Off the top of my head, I can think of the following workaround:

Add branch protection to the release branches disallowing pushes and require at least one PR approval

That way, you ensure that no merges are pushed, and if you do want to circumvent that, it needs to pass through a human filter first.