User:Dan-nl/Git and Gerrit/The Workflow

tl;dr

 * The initial  and   of a branch will create a changeset in gerrit. Note the difference between the   command for the changeset vs. the patchset.


 * Subsequent s and  s will create patchsets.

Gerrit & Git
Gerrit implements a different perspective on commits than git. In general :

Gerrit In Gerrit, each commit is considered a Change-Set that needs to be reviewed before possibly being merged into the master branch. These Change-Sets most likely depend on each other in order for the code to work properly, yet each Change-Set needs to be approved before all of them can be merged into the master branch. Because of this approach, you typically create one Change-Set and modify it by amending commits to it, which create Patch-Sets for that Change-Set. These Patch-Sets can then be approved or discarded. Once all of the Patch-Sets of a Change-Set have been approved, or discarded if necessary, the Change-Set can then be merged into the master branch if final approval by the core team is given.

Git In Git, each commit is an atomic change that does not need to be reviewed, but continuously contributes to the completion of a development branch. Once work on the development branch is completed, it may then be merged, in its entirety, into the master branch if approved by your team.

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.

Merge with master
If you are the primary author/maintainer of the code and the code has not yet been deployed to the Wikimedia cluster, you can merge the branch with the master branch by reviewing the branch in Gerrit with +2 and verifying with +2; otherwise, someone from the foundation will need to do that for you.