Git how to protect branches against force push and deletion

It is possible in git to change the repository history. This might be handy in feature branches but is usually not wanted for master or release branches (R14 / R15 / …). You can protect branches against force push and deletion in gitea against this using the following settings.

The whitelist team selection might be different depending on your group's setup. But please add as many as possible since we generally want to keep an open system.

Video guide:


Gitea Server:

See also


It might be possible to automate the configuration process of this setting. But our gitea version is missing the required API endpoint. The HTTP endpoint can be previewed using the gitea project demo API ​/repos​/{owner}​/{repo}​/branch_protections (as of 2020-07-10)

-- BenjaminPeter - 10 Jul 2020
Topic revision: r2 - 04 Nov 2021, ChristophHandel
This site is powered by FoswikiCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding Foswiki? Send feedback