Gerrit 2.14 Getting Started Guide

Source: Internet
Author: User
Tags flush ssh version control system

Gerrit is a free, open source code review and code base management software that uses the Git codebase as a version control system and can be accessed through the command line, rest, and web interface.

1. Version

As of May 2017, the latest version 2.14.

2. Download link

Https://gerrit-releases.storage.googleapis.com/gerrit-2.14.war

3. Installation

Java-jar ~/gerrit-2.14.war init-d ~/mygerritsite

Note that the ~/mygerritsite is the installation path.

The configuration parameters during installation are as follows: location of git repositories, default git Database server type, default H2 authentication method, default OpenID Run as, default current user J Ava runtime, path to JRE ssh Daemon Listen on address, default * Listen on port, Gerrit SSH listener port default 29418 HTTP Daemon Behind Reverse Pro XY, default y use SSL, default y Listen on address, default * Listen on port, Gerrit Web listener port default 8888

4.Gerrit Installation Content

After installation, the environment variables are set by default: $site _path=~/mygerritsite gerrit.basepath= $site _path/git/
...

Gerrit installation directory, that is, $site_path, mainly consists of two types of files, one is Gerrit metadata files, and the other is a git library data files.

1) Gerrit metadata is divided into the following files: Configuration file $site_path/etc/gerrit.config H2 data file server SSH keys file

View the Gerrit configuration file as follows:

[Gerrit]
    BasePath = git
    canonicalweburl = Http://gerrit.server
[auth]
    type = http
[container]
    user = Gerritadmin
    javahome =/opt/jdk1.6.0_38/jre
[sshd]  
    listenaddress = *:29418
[httpd]  
    Listenurl = proxy-http://localhost:8888/
[Cache]  
    directory = cache

2) The GIT library data file is located by default in $site_path/git/.

If you want to change the GIT library, using a different git library, you need to execute the following command: Initialize the GIT library

git--git-dir= $my _path/new/myproject.git init

Create a Git-daemon-export-ok file to support anonymous access

Touch $base _path/new/myproject.git/git-daemon-export-ok

Restart the Gerrit server, or flush project_list cache to register the GIT library

Ssh-p 29418 localhost Gerrit flush-caches--cache project_list

The 5.Gerrit Web server is embedded in jetty by default, and the command to stop the Web server is as follows:

~/mygerritsite/bin/gerrit.sh start
~/mygerritsite/bin/gerrit.sh stop
~/mygerritsite/bin/gerrit.sh restart


You can access http://localhost:8888/by opening your browser.


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.