Separate branch creation and commits in branch permission rules #13606

Open
opened 2025-11-02 10:48:00 -06:00 by GiteaMirror · 2 comments
Owner

Originally created by @amix307 on GitHub (Oct 16, 2024).

Feature Description

Hi,

The current branch permission rules allow restricting commits to certain branches, such as release/** etc. However, these rules also block branch creation, as creating a branch is treated as a commit.

The issue is that when using a Git client, creating a new branch can include changes immediately, so blocking commits makes sense. However, when creating a branch through the UI, this action typically only involves creating an empty branch with no changes, and blocking it may not always be justified.

Would it be possible to add the option to allow branch creation (especially through the UI), while still preventing commits? This would make branch management more flexible and user-friendly.

Or could you advise how to enable branch creation from the UI with branch permission rules active, without using whitelists or other exceptions?

Screenshots

No response

Originally created by @amix307 on GitHub (Oct 16, 2024). ### Feature Description Hi, The current branch permission rules allow restricting commits to certain branches, such as release/** etc. However, these rules also block branch creation, as creating a branch is treated as a commit. The issue is that when using a Git client, creating a new branch can include changes immediately, so blocking commits makes sense. However, when creating a branch through the UI, this action typically only involves creating an empty branch with no changes, and blocking it may not always be justified. Would it be possible to add the option to allow branch creation (especially through the UI), while still preventing commits? This would make branch management more flexible and user-friendly. Or could you advise how to enable branch creation from the UI with branch permission rules active, without using whitelists or other exceptions? ### Screenshots _No response_
GiteaMirror added the proposal/acceptedtype/proposal labels 2025-11-02 10:48:00 -06:00
Author
Owner

@lunny commented on GitHub (Oct 22, 2024):

Maybe we can have an option, to allow create branches from other branches.

@lunny commented on GitHub (Oct 22, 2024): Maybe we can have an option, to allow create branches from other branches.
Author
Owner

@amix307 commented on GitHub (Oct 23, 2024):

Maybe we can have an option, to allow create branches from other branches.
@lunny yeah! smthng like this, great

@amix307 commented on GitHub (Oct 23, 2024): > Maybe we can have an option, to allow create branches from other branches. @lunny yeah! smthng like this, great
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#13606