gerrit.wikimedia.org
Gerrit Code Review - Project Configuration
Version V3.3.9
Table of Contents
Project Creation
Manual Project Creation
Project Options
Branch Administration
Branch Creation
Branch Deletion
Default Branch
Project Creation
There are several ways to create a new project in Gerrit:
To be able to create new projects the global capability Create Project must be granted.
In addition, projects can be created manually.
Manual Project Creation
  1. Create a Git repository under gerrit.basePath:
    git --git-dir=$base_path/new/project.git init
    TIPBy tradition the repository directory name should have a .git suffix.
    To also make this repository available over the anonymous git:// protocol, don’t forget to create a git-daemon-export-ok file:
    touch $base_path/new/project.git/git-daemon-export-ok
  2. Register Project
    Either restart the server, or flush the project_list cache:
    ssh -p 29418 localhost gerrit flush-caches --cache project_list
Project Options
See details at project section.
Branch Administration
Branch Creation
There are several ways to create a new branch in a project:
To be able to create new branches the user must have the Create Reference access right.
When using the Web UI, the REST endpoint or the SSH command it is only possible to create branches on commits that already exist in the repository.
If a branch name does not start with refs/ it is automatically prefixed with refs/heads/.
The starting revision for a new branch can be any valid SHA-1 expression, as long as it resolves to a commit. Abbreviated SHA-1s are not supported.
Branch Deletion
There are several ways to delete a branch:
To be able to delete branches, the user must have the Delete Reference or the Push access right with the force option.
Default Branch
The default branch of a remote repository is defined by its HEAD. For convenience reasons, when the repository is cloned Git creates a local branch for this default branch and checks it out.
Project owners can set HEAD
Part of Gerrit Code Review
Version v3.3.9