Git/Guide

Cloning MediaWiki's git repository
If you just want to clone it but don't plan on doing any pushing, do this: git clone https://gerrit.wikimedia.org/r/p/test/mediawiki/core.git

If you've got an account and you plan to do pushes, clone using the following: git clone ssh:// @gerrit.wikimedia.org:29418/test/mediawiki/core.git

The resulting git repository contains the full history of trunk, branches, and tags to work on locally. The cloning process can take a few minutes to complete depending on your internet connection (there's a lot of history there!), so feel free to grab a coffee.

Working with Git
If you're going to be committing: Before you do anything, run the git-setup file found in the repository's root. This will setup your pre-commit hook and configure your clone for working with gerrit.

Checking out new branches
By default you only track the  branch which corresponds to Subversion's. To check out and track another branch do:

git checkout -b REL1_15 --track origin/REL1_15

Commit
First commit your changes locally as usual, e.g.,

git add foo.php includes/bar.php git commit git push-for-review

This will push your revision to gerrit for review, provided it cleanly merges with the current HEAD.

Links

 * Git and gerrit in Wikimedia sites
 * NOLA Hackathon/Sunday
 * File:Git notes - NOLA Hackathon 2011.pdf
 * File:Git notes - NOLA Hackathon 2011.oga
 * Git's website with documentation
 * An intro-to-git "training mission"
 * An introduction to git-svn for Subversion/SVK users and deserter by Sam Vilain
 * A git branching model
 * git: the simple guide