GitRoot

Craft your forge // Build your project // Grow your community freely
 1<!--
 2SPDX-FileCopyrightText: 2025 Romain Maneschi <romain@gitroot.dev>
 3
 4SPDX-License-Identifier: CC-BY-SA-4.0
 5-->
 6
 7# Not accepting anonymous contribution
 8
 9## By avoiding rights
10
11If you want to fine-tune who can do what a simple way is to say that all users not registered has no branch in `.gitroot/users.yml`:
12
13```yml
14noAnonymous:
15  branches:
16    - name: "*"
17  users: []
18```
19
20You will need to add each ssh key of your contributors see [add an user](./add_user.md) to do it.
21
22> Be sure to have at least one user in main branch to be able to modify it, else no one will be able to modify anything.
23
24If an anonymous user push a new branch to the repository he will have a `you can't write in $branchName` error.
25
26## By avoiding branches
27
28Another way to do that is to set `nbmaxbranchesbeforerejectinganonymous=0` in the [repository configuration file](../technicals/repo_configuration.md). The result will the same, no anonymous push but what differ is the error the user will have.
29
30If an anonymous user push a new branch to the repository he will have a `anonymous branches not allowed` error.