Manual:Pywikibot/Gerrit

Pywikibot is currently moving to Gerrit! This is a simple FAQ/how-to page on what you need to do.

Terminology

 * Git - a version control system. Replaces SVN.
 * Gerrit - a code review platform (http://gerrit.wikimedia.org). Replaces Special:CodeReview
 * compat - formerly known as "trunk". If you're not sure, you probably use this.
 * core - formerly known as "rewrite".

Git clients
For example in order to download core via commandline:
 * Windows users: We recommend you use TortoiseGit
 * OSX/Linux: commandline git - http://git-scm.com/

To update:

If you're lazy and want to be able to do that all at once, you can do: (copied from ) [add '--global' to make this alias stick for all projects]

Be noticed these codes are a little big (just a little, for example compat is 170 MBs) because you're downloading the whole history of codes so if size of codes are important for you (e.g. because of hard disk limits in servers or low internet speed) you can simply clone shallow version of code, for example this command downloads only the last three revisions:

Using SVN
But wait... I don't want to use Git. Can I still use SVN? Yes! For this example, I'm going to use pwb-core, however you can easily switch compat in.

Updating is as simple as

Urls
Your client will probably ask you for the repository url. The urls follow the format of:.

So for compat:.

So for core:.

Nightly distributions
You can download the whole packages or brows in codes via nightly distributor in Wikimedia Labs

For developers
Follow steps in Gerrit/Getting started and run this: and after modifying codes follow steps in Gerrit/Tutorial
 * How to submit patches...configure git/gerrit. etc.

Example (step-by-step)
So for example if you want to work with compat (formerly known as trunk), do the following, step-by-step:
 * 1) setup your software:
 * 2) (ssh key and all the stuff like for svn needed ...)
 * 3) install 'git' package
 * 4) install 'git-review' package
 * 5) clone and setup your repo:
 * 6) clone the git repo by using (like svn checkout)
 * 7) enter the directory
 * 8) config git setting for this repo/directory only  and
 * 9) config your terminal/console to output english messages (in order to work properly with git review)
 * 10) setup git review for this repo only
 * 11) work with the repo, e.g. commit patches for review:
 * 12) switch to the master branch
 * 13) update the current branch from online (like svn update)
 * 14) create your own local temporary branch for working
 * 15) Now write some code. See the Git commands add, rm and mv to add, remove or rename files. When you're ready go to the next step.
 * 16) Commit your changes to your local temporary branch with
 * 17) Optionally check your changes by looking at the committed data
 * 18) Send the data to the online repository, resp. gerrit for review (like svn commit)