Working with Git and Gerrit » History » Version 24

Karsten Dambekalns, 2010-08-13 11:45
Split page into multiple pages to make it more readable and less intimidating

1 1 Karsten Dambekalns
h1. Working with Git and Gerrit Code Review
2 22 Karsten Dambekalns
3
{{>toc}}
4 1 Karsten Dambekalns
5 20 Karsten Dambekalns
*Note:* We have not yet switched to Git and Gerrit, but are currently in the process of doing so. Planned date for the switch to git for FLOW3 and TYPO3 Phoenix projects is August 23rd.
6 1 Karsten Dambekalns
7 20 Karsten Dambekalns
For FLOW3 and TYPO3 Phoenix we are using Git and the Gerrit Code Review system to channel commits for review.
8 1 Karsten Dambekalns
9 20 Karsten Dambekalns
Now here is what you need to know to contribute, more details on Git are available in the "Pro Git book":http://progit.org/book/, the "Gerrit documentation":https://review.typo3.org/Documentation/index.html and other resources.
10 1 Karsten Dambekalns
11
h2. Git
12
13 24 Karsten Dambekalns
h3. [[Working with Git]]
14 1 Karsten Dambekalns
15 24 Karsten Dambekalns
h2. Gerrit Code Review
16 1 Karsten Dambekalns
17
h3. Registering with gerrit
18
19
To register with gerrit, visit https://review.typo3.org/ and log in using your typo3.org username. Click on 'Settings' -> 'Profile', and check that gerrit correctly knows your name and email address.
20
21
In order to be able to upload code, you now need to create a ssh key that gerrit can use to identify you, or tell gerrit about one that already exists.
22
23
To create a new ssh key, if you don't already have one, run
24
<pre>ssh-keygen -t dsa -f ~/.ssh/id_dsa</pre>
25
The public key for this is now stored in ~/.ssh/id_dsa.pub.
26 23 Karsten Dambekalns
27
To tell gerrit about your key, log in, and go to 'Settings'. Select 'SSH Keys', and paste your public key into the "Add SSH Public Key" box, or click on the 'Open Key...' option to load it from the filesystem. Click on 'Add' to add the new public key.
28 1 Karsten Dambekalns
To make things easier, set up ssh so that it knows about the defaults for the gerrit server. Edit @~/.ssh/config@, and add a section like:
29
<pre>Host review.typo3.org 
30 23 Karsten Dambekalns
User <username> 
31 1 Karsten Dambekalns
IdentityFile ~/.ssh/id_dsa 
32
Port 29418</pre>
33 23 Karsten Dambekalns
(where <username> is what you logged in with, i.e. your typo3.org username)
34 1 Karsten Dambekalns
35 23 Karsten Dambekalns
To verify your ssh key is working correctly, try using an ssh client to connect to gerrit. You should get the following output if it all works:
36 1 Karsten Dambekalns
<pre>$ ssh review.typo3.org
37 23 Karsten Dambekalns
gerrit: no shell available
38
Connection to review.typo3.org closed.</pre>
39 4 Karsten Dambekalns
40 24 Karsten Dambekalns
h3. [[Working with Gerrit as a Developer]]
41 4 Karsten Dambekalns
42 24 Karsten Dambekalns
h3. [[Working with Gerrit as a Reviewer]]
43 4 Karsten Dambekalns
44
h2. Thanks
45 2 Karsten Dambekalns
46
... to the folks over at "OpenAFS":http://openafs.org/ that made us stumble over gerrit and whose wiki page we shamelessly used as a base for this page.
47
48 23 Karsten Dambekalns
... to Sebastian Kurf├╝rst, Peter Niederlag, Christopher Hlubek for their help with git, gerrit and redmine.
49
50
... Bastian Waidelich for being the brave Windows test user.
51 5 Karsten Dambekalns
52 1 Karsten Dambekalns
... to the TYPO3 Core Team for being open towards a change in SCM flavor.