Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 37 additions & 1 deletion book/04-git-server/1-git-server.asc
Original file line number Diff line number Diff line change
Expand Up @@ -821,7 +821,43 @@ One benefit to GitLab is that, once the server is set up and running, you'll rar

=== Gerrit

TODO: Gerrit
==== Installing Gerrit

First, install Gerrit. It's actually really simple to do so. You download the latest war file from the Gerrit website and run it. This initializes the project and starts a web server on port `8080` by default.

[source,script]
----
$ wget https://gerrit-releases.storage.googleapis.com/gerrit-2.8.5.war
$ java -jar gerrit.war init --batch -d ~/gerrit_testsite
Generating SSH host key ... rsa(simple)... done
Initialized /home/gerrit2/gerrit
Executing /home/gerrit2/gerrit/bin/gerrit.sh start
Starting Gerrit Code Review: OK
----

Now you can go to `http://gitserver:8080` (or whatever your server name is) and see Gerrit running.

The server will ask you to log in via OpenID and the first user to do so will become an Administrator. As part of the user registration process, Gerrit will ask you for your SSH public key. This is mandatory to use Git with Gerrit, so be aware that all of your users will need to generate and upload SSH keys.

Once you're registered, you can test to see if you have a valid account by SSHing into the server. Gerrit by default will open it's SSH server on a nonstandard port of `29418`.

[source,script]
----
$ ssh schacon@git.example.com -p 29418

**** Welcome to Gerrit Code Review ****

Hi Scott Chacon, you have successfully connected over SSH.

Unfortunately, interactive shells are disabled.
To clone a hosted Git repository, use:

git clone ssh://schacon@git.example.com:29418/REPOSITORY_NAME.git

Connection to git.example.com closed.
----

Great, so we now have a working Gerrit web and SSH server and an active account. You should be able to simply point the rest of your team to the server and let them sign themselves up.

=== Third Party Hosted Options

Expand Down