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: https://sf.gsi.de/f/4658f88b9a244988936f/

gitea-branch-protection.png

Gitea Server: https://git.acc.gsi.de/

See also

Automation

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 https://try.gitea.io/api/swagger#/repository/repoListBranchProtection (as of 2020-07-10)

-- BenjaminPeter - 10 Jul 2020
Topic revision: r1 - 10 Jul 2020, BenjaminPeter
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