Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Restrict branch creation #21274

Closed
PaulBol opened this issue Sep 27, 2022 · 3 comments
Closed

Restrict branch creation #21274

PaulBol opened this issue Sep 27, 2022 · 3 comments
Labels
type/feature Completely new functionality. Can only be merged if feature freeze is not active. type/proposal The new feature has not been accepted yet but needs to be discussed first.

Comments

@PaulBol
Copy link

PaulBol commented Sep 27, 2022

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

@PaulBol PaulBol added type/feature Completely new functionality. Can only be merged if feature freeze is not active. type/proposal The new feature has not been accepted yet but needs to be discussed first. labels Sep 27, 2022
@lafriks
Copy link
Member

lafriks commented Sep 27, 2022

Duplicate of #2529

@lafriks lafriks marked this as a duplicate of #2529 Sep 27, 2022
@lafriks lafriks closed this as completed Sep 27, 2022
@PaulBol
Copy link
Author

PaulBol commented Sep 27, 2022

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
Copy link
Member

lafriks commented Sep 27, 2022

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

@go-gitea go-gitea locked and limited conversation to collaborators May 3, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
type/feature Completely new functionality. Can only be merged if feature freeze is not active. type/proposal The new feature has not been accepted yet but needs to be discussed first.
Projects
None yet
Development

No branches or pull requests

2 participants