Git/Creating new repositories

This is designed to be a quick and dirty tutorial for people who are creating new repositories

Step 0: Read and understand Gerrit docs
There's two sections of the Gerrit docs that you need to read and be familiar with before attempting to create repositories:
 * 1) Gerrit access controls - You almost always will be setting permissions after creating a new repository, so it's important to understand what each of the permissions means and how to use them
 * 2) create-project command - You will be creating the repository via the command line, so make sure you've read and understand the various options available via the command line (especially the --parent and --owner switches!)

Step 1: Pick your repository name
Before you begin, make sure you've decided on a repository name that you do not want to change. Renaming repositories is near impossible, so you need to make sure you're happy with your name before you create it.

Step 2: Pick your repository's home
For organization (and permission) purposes, we use top-level project names (like mediawiki/* or operations/*) to put repositories in. It's best to not create new top-level repositories without discussing it first, so the top-levels can be named and setup in a way that is useful and descriptive.

Step 2: Create the repository
Even though there's a way to create new repositories via the Gerrit web interface, please don't use that GUI. There's a couple of shortcomings, so please create the new repository via the command line. Let's say we were making a new repository called test/my-new-repo, so the command would be as follows: ssh -p 29418 gerrit.wikimedia.org gerrit create-project --owner=MyGroup --parent=test --description='"My super awesome repository"' test/my-new-repo

Important Caveats
Setting the --parent switch is very important so you inherit the permissions from the containing repository. If you don't specify the parent, the parent defaults to All-Projects, which is nearly useless for most repositories. The parent can be adjusted via a Gerrit admin if you get it wrong, however.

Setting the --owner switch is even more important because if you don't set the owner of a repository to a group you're a member of, you will be unable to adjust the permissions on your newly created repository (and you'll have to ask a Gerrit admin to fix that).

Step 3: Set permissions (if needed)
In some cases, you may want to adjust permissions beyond what's inherited from the parent repository. Once the repo is created (and you're an Owner), you can then adjust the permissions via the Gerrit web UI.