Branch Protection Impossible For New Repositories #7283

Closed
opened 2025-11-02 07:21:42 -06:00 by GiteaMirror · 3 comments
Owner

Originally created by @muellert on GitHub (May 3, 2021).

  • Gitea version (or commit ref): 1.14.1
  • Git version: n/a
  • Operating system: n/a
  • Database (use [x]):
    • PostgreSQL
    • MySQL
    • MSSQL
    • SQLite
  • Can you reproduce the bug at https://try.gitea.io:
    • Yes (provide example URL) any, really
    • No
  • Log gist:

Description

If I create a new repository, it is initially empty. In this case, I cannot set up branch protection, at least not via the UI.

Maybe templating could work around this?

...

Screenshots

20210503-gitea-repo-in-use
20210503-gitea-new-repo

Originally created by @muellert on GitHub (May 3, 2021). <!-- NOTE: If your issue is a security concern, please send an email to security@gitea.io instead of opening a public issue --> - Gitea version (or commit ref): 1.14.1 - Git version: n/a - Operating system: n/a <!-- Please include information on whether you built gitea yourself, used one of our downloads or are using some other package --> <!-- Please also tell us how you are running gitea, e.g. if it is being run from docker, a command-line, systemd etc. ---> <!-- If you are using a package or systemd tell us what distribution you are using --> - Database (use `[x]`): - [ ] PostgreSQL - [ ] MySQL - [ ] MSSQL - [ ] SQLite - Can you reproduce the bug at https://try.gitea.io: - [x] Yes (provide example URL) any, really - [ ] No - Log gist: <!-- It really is important to provide pertinent logs --> <!-- Please read https://docs.gitea.io/en-us/logging-configuration/#debugging-problems --> <!-- In addition, if your problem relates to git commands set `RUN_MODE=dev` at the top of app.ini --> ## Description If I create a new repository, it is initially empty. In this case, I cannot set up branch protection, at least not via the UI. Maybe templating could work around this? ... ## Screenshots <!-- **If this issue involves the Web Interface, please include a screenshot** --> ![20210503-gitea-repo-in-use](https://user-images.githubusercontent.com/1183079/116870044-afdb4c80-ac09-11eb-9788-46b0e5fc2730.png) ![20210503-gitea-new-repo](https://user-images.githubusercontent.com/1183079/116870050-b36ed380-ac09-11eb-88ec-b43585c69e89.png)
GiteaMirror added the type/enhancement label 2025-11-02 07:21:42 -06:00
Author
Owner

@KN4CK3R commented on GitHub (May 3, 2021):

I noticed that too while implementing #15629 but did not add that restriction there. At the moment you must select an existing branch to enable branch protection. As an empty repository does not have branches that tab is stripped. #2529 might want this too.

@KN4CK3R commented on GitHub (May 3, 2021): I noticed that too while implementing #15629 but did not add that restriction there. At the moment you must select an existing branch to enable branch protection. As an empty repository does not have branches that tab is stripped. #2529 might want this too.
Author
Owner

@lunny commented on GitHub (Oct 19, 2022):

Will also be fixed by #20825

@lunny commented on GitHub (Oct 19, 2022): Will also be fixed by #20825
Author
Owner

@lunny commented on GitHub (Jan 16, 2023):

Fixed by #20825

@lunny commented on GitHub (Jan 16, 2023): Fixed by #20825
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#7283