User:Dan-nl/Git and Gerrit/Developing for an existing gerrit project

These instructions assume you have already followed the steps mentioned in Setup your Development Environment

tl;dr
Continue with the Gerrit Workflow instructions.

Find the project on Gerrit

 * 1) Log into your MediaWiki gerrit account
 * 2) Locate the project on the gerrit projects page
 * 3) Click on the link to go to the project’s overview page e.g. https://gerrit.wikimedia.org/r/#/admin/projects/mediawiki/extensions/UploadWizard

Find the ssh:// clone url

 * 1) Click on the Branches menu at the left
 * 2) Determine which Branch of the repository you want to work on
 * 3) Click on the link (gitweb) next to the branch name and revision e.g. HEAD master (gitweb)
 * 4) Click on the summary menu
 * 5) Make sure you use the   url to clone the repository; the   version will cause a problem with setting up git review.

Clone the repository

 * 1) open a terminal window
 * 2) navigate to the directory where you want to work on the extension, e.g.,
 * 3) clone the repository using “-o gerrit” tells git to use the remote nickname, “gerrit” instead of the default “origin”, which is important for  . see Incorrect remote for further information.

Prepare to work with Gerrit
From within the cloned repository, run the following command. which will set up git to use the  hook when pushing new code to the remote gerrit repository.

Update master
Make sure that your master branch (the branch created when you initially cloned the repository) is up to date:

Create a branch
First, create a local branch for your new change. Give the branch a short but reasonably descriptive name. If you are working on a bug, include its id, for example "bug/12345" (this will be what git-review sets the commit‘s topic to anyway). The following will create a new branch from ‘master’ and check it out for you.

Continue with the Workflow
Continue with the Gerrit Workflow instructions.