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

Workflow
Continue with the Gerrit Workflow instructions.

Find the extension 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 clone url
Typically this will be formated as the following, however, it’s good to know how to retrieve a project’s clone url from gerrit
 * ssh://@gerrit.wikimedia.org:29418/mediawiki/extensions/.git


 * 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”

Prepare to work with gerrit
From within the cloned repository, run the following command to set it up before you commit your first change for review.

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.

Workflow
Continue with the Gerrit Workflow instructions.