Working with Git and Gerrit » History » Version 25

Sebastian Kurfuerst, 2010-08-20 22:12

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 25 Sebastian Kurfuerst
h2. Quickstart Guide
12
13
*For a quick "Getting Started" guide, see the [[Gerrit and Git Quickstart]]*
14
15 1 Karsten Dambekalns
h2. Git
16
17 24 Karsten Dambekalns
h3. [[Working with Git]]
18 1 Karsten Dambekalns
19 24 Karsten Dambekalns
h2. Gerrit Code Review
20 1 Karsten Dambekalns
21
h3. Registering with gerrit
22
23
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.
24
25
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.
26
27
To create a new ssh key, if you don't already have one, run
28
<pre>ssh-keygen -t dsa -f ~/.ssh/id_dsa</pre>
29
The public key for this is now stored in ~/.ssh/id_dsa.pub.
30 23 Karsten Dambekalns
31
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.
32 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:
33
<pre>Host review.typo3.org 
34 23 Karsten Dambekalns
User <username> 
35 1 Karsten Dambekalns
IdentityFile ~/.ssh/id_dsa 
36
Port 29418</pre>
37 23 Karsten Dambekalns
(where <username> is what you logged in with, i.e. your typo3.org username)
38 1 Karsten Dambekalns
39 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:
40 1 Karsten Dambekalns
<pre>$ ssh review.typo3.org
41 23 Karsten Dambekalns
gerrit: no shell available
42
Connection to review.typo3.org closed.</pre>
43 4 Karsten Dambekalns
44 24 Karsten Dambekalns
h3. [[Working with Gerrit as a Developer]]
45 4 Karsten Dambekalns
46 24 Karsten Dambekalns
h3. [[Working with Gerrit as a Reviewer]]
47 4 Karsten Dambekalns
48
h2. Thanks
49 2 Karsten Dambekalns
50
... 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.
51
52 23 Karsten Dambekalns
... to Sebastian Kurf├╝rst, Peter Niederlag, Christopher Hlubek for their help with git, gerrit and redmine.
53
54
... Bastian Waidelich for being the brave Windows test user.
55 5 Karsten Dambekalns
56 1 Karsten Dambekalns
... to the TYPO3 Core Team for being open towards a change in SCM flavor.