Git/Gerrit Installation and Setup

From Tizen Wiki
Jump to: navigation, search

Install and Configure Git

Git is a free and open source distributed version control system designed to handle everything from small to very large projects with speed and efficiency.
You can find more information on http://git-scm.com

Git Installation on openSUSE

# zypper install git

Git configuration

# git config --global user.name [user_name]
# git config --global user.email [user_email]
# git config --global color.ui auto


Install and Configure Gerrit

Gerrit provides web based code review and repository management for the Git version control system.
You can find more information on https://www.gerritcodereview.com/

Add user

# useradd gerrit

Install mySQL on openSUSE

Gerrit requires mySQL db to register information.

# zypper install mysql mysql-client

mySQL Configuration

# /usr/bin/mysqladmin -u root password [your_new_password]
# mysql -u root -p
Enter password: [your_mysql_password]
mysql> CREATE DATABASE reviewdb; mysql> GRANT ALL PRIVILEGES ON reviewdb.* TO gerrit@'[your_host_ip]' IDENTIFIED BY '[your_mysql_password]'; mysql> GRANT ALL PRIVILEGES ON reviewdb.* TO gerrit@'127.0.0.1' IDENTIFIED BY '[your_mysql_password]'; mysql> GRANT ALL PRIVILEGES ON reviewdb.* TO gerrit@'localhost' IDENTIFIED BY '[your_mysql_password]'; mysql> FLUSH PRIVILEGES;

Gerrit Installation on openSUSE

# wget http://gerrit-releases.storage.googleapis.com/gerrit-2.9.1.war
# java -jar gerrit-2.9.1.war init -d '/usr/local/gerrit'
# /usr/local/gerrit/bin/gerrit.sh start

Apache2 Configuration

# vi /etc/apache2/httpd.conf
  Add 'IncludeOptional /etc/apache2/vhosts.d/*.conf'
# vi /etc/apache2/vhosts.d/gerrit.conf 
<VirtualHost [your_host_ip]:80> ServerName [your_host_ip] DocumentRoot "/var/www" ProxyRequests Off ProxyVia Off ProxyPreserveHost On AllowEncodedSlashes On ProxyPass /gerrit http://127.0.0.1:8081/gerrit nocanon </VirtualHost>

Access Gerrit web page

http://[your_host_ip]/gerrit

Troubleshooting

'#' means that you work with super user