# Block merge from master branch

**URL:** <https://forum.gitea.com/t/block-merge-from-master-branch/4457>\
**Category:** Install/Maintain/Configure\
**Created:** [January 19, 2022, 5:10pm UTC](https://forum.gitea.com/t/block-merge-from-master-branch/4457 "2022-01-19T17:10:31Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![crapp](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.gitea.com/crapp/32/2119_2.png) [@crapp](https://forum.gitea.com/u/crapp)\
**Post date:** [January 19, 2022, 5:10pm UTC](https://forum.gitea.com/t/block-merge-from-master-branch/4457/1 "2022-01-19T17:10:31Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![dachary](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.gitea.com/dachary/32/4990_2.png) [@dachary](https://forum.gitea.com/u/dachary)\
**Post date:** [January 19, 2022, 8:31pm UTC](https://forum.gitea.com/t/block-merge-from-master-branch/4457/2 "2022-01-19T20:31:34Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![crapp](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.gitea.com/crapp/32/2119_2.png) [@crapp](https://forum.gitea.com/u/crapp)\
**Post date:** [January 20, 2022, 8:16am UTC](https://forum.gitea.com/t/block-merge-from-master-branch/4457/3 "2022-01-20T08:16:03Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![bartvdbraak](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.gitea.com/bartvdbraak/32/6058_2.png) [@bartvdbraak](https://forum.gitea.com/u/bartvdbraak)\
**Post date:** [June 28, 2024, 12:52pm UTC](https://forum.gitea.com/t/block-merge-from-master-branch/4457/4 "2024-06-28T12:52:01Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![delvh](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.gitea.com/delvh/32/5047_2.png) [@delvh](https://forum.gitea.com/u/delvh)\
**Post date:** [June 28, 2024, 8:31pm UTC](https://forum.gitea.com/t/block-merge-from-master-branch/4457/5 "2024-06-28T20:31:25Z")

</div>

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.
