Recommended for you: Get network issues from WhatsUp Gold. Not end users.



1.         Install Gerrit

CentOS release 6.2 (Final)

Linux localhost 2.6.32-220.el6.x86_64 #1 SMP Tue Dec 6 19:48:22 GMT 2011 x86_64 x86_64 x86_64 GNU/Linux


vi /etc/selinux/config



service iptables stop

chkconfig iptables off

rpm -Uvh mod_wsgi-3.3-7.1.x86_64.rpm



cp gerrit-2.7.war /opt/

cd /opt

sh jdk-6u25-linux-x64.bin

service mysqld start

mysqladmin -u root password 123456

mysql -uroot -p123456

mysql> create user 'gerrit'@'localhost' identified by 'secret';

mysql> create database gerrit;

mysql> alter database gerrit charset=latin1;

mysql> grant all on gerrit.* to 'gerrit'@'localhost';

mysql> flush privileges;

mysql> status;

mysql> quit

java -jar gerrit-2.7.war init -d /opt/gerrit/

vi gerrit/etc/gerrit.config


        basePath = git

        canonicalWebUrl =


        type = mysql

        hostname = localhost

        database = gerrit

        username = gerrit


        type = LDAP


        server = ldap://

        username = cn=Manager,dc=example,dc=com

        password = mmjjjj

        accountBase = ou=People,dc=example,dc=com

        accountPattern = (&(objectClass=*)(uid=${username}))

        accountFullName = uid

        accountEmailAddress = mail


        smtpServer =

        smtpUser = code

        from =

        smtpPass = 1111111


        user = root

        javaHome = /opt/jdk1.6.0_25/jre


        listenAddress = *:29418


        listenUrl = http://*:8080/gerrit


        directory = cache

/opt/gerrit/bin/ start

tail -f /opt/gerrit/logs/error_log


Close the anonymous permissions



2.         The installation of Linux git client

General use Linux with Git

ssh-keygen -t rsa

The contents of the.Ssh/ file copy to the following positions in the Gerrit is stored


Test connection

ssh wangjian@ -p 29418

To configure

git clone ssh://wangjian@

cd test

scp -p -P 29418 wangjian@  .git/hooks/

scp -p -P 29418 wangjian@  .

A test submission

date > testfile.txt

git add testfile.txt

git commit -m "My pretty test commit"

git push origin HEAD:refs/for/master


3.         The installation of windows git client

Install Git-1.8.3-preview20130601.exe

The default installation

Install TortoiseGit-

The installation steps to select "TortoisePlink". Other steps to default on the line!


Key generation


The public key stored in the Gerrit copy to

Download the library



Put a commit-msg in the test/.git/hooks directory


Willgerrit-cherry-pickIn the test/ directory

A test submission






4.         git-repo


5.         git-review


Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download

Posted by Judy at February 21, 2014 - 2:29 PM