Skip to content

Restrict branch creation #21274

@PaulBol

Description

@PaulBol

Feature Description

I had the same question that someone asked for GitHub here:

I was wondering if there is anyway to restrict the branch creation in GitHub Gitea. I have 4-5 branches created for a repo and would like to maintain it that way.

The idea is that developers work in their own repositories and merge into the main repository and branch through pull requests. Without the option of accidentally or willingly creating new branches in the main repository.

The answer given is that as of May 2022 GitHub has a branch protection setting named Restrict pushes that create matching branches. Adding a rule * will prevent the creation of any new branch.

It would be awesome if Gitea could support the same.

Screenshots

grafik

Activity

added
type/featureCompletely new functionality. Can only be merged if feature freeze is not active.
type/proposalThe new feature has not been accepted yet but needs to be discussed first.
on Sep 27, 2022
lafriks

lafriks commented on Sep 27, 2022

@lafriks
Member

Duplicate of #2529

PaulBol

PaulBol commented on Sep 27, 2022

@PaulBol
Author

I saw issue #2529 but thought it was a different suggestion.

My understanding was that with the implementation of #2529 newly created branches automatically fall under branch protection if matching the wildcard once created. I now assume that pull request #20825 can also be used to prevent pushes that would create branches matching the wildcard. That will be great!

lafriks

lafriks commented on Sep 27, 2022

@lafriks
Member

yes you could use * to protect all branches once wildcard branch protection is implemented

locked and limited conversation to collaborators on May 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    type/featureCompletely new functionality. Can only be merged if feature freeze is not active.type/proposalThe new feature has not been accepted yet but needs to be discussed first.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @lafriks@PaulBol

        Issue actions

          Restrict branch creation · Issue #21274 · go-gitea/gitea