RSS

Tag Archives: technology

Git server with gitolite,gitweb and gerrit integration on linux ubuntu 10.04/12.04

Hi,

This blog gives the information about how to create your own git server and integrate some useful tools mentioed below.

  1. Gitolite (admin control)
  2. Gitweb (web interface of sourcecode)
  3. Gerrit (code review tool)

Follow below steps to do complete integration:

  1. install git on your local PC
    1. $sudo apt-get install git-core gitk git-gui
  2. Install apache2 server on your local PC which install sshd to connect other network PC
    1. $sudo apt-get install apache2
  3. create your keys on your local PC
    1. $cd /home/your-login
    2. $cd ~
    3. $ssh-keygen -t -rsa
      1. don’t enter username and password
      2. complete the steps and it will create .ssh folder in your home directory
    4. $ls -ahl to view .ssh directory
  4. Install git on remote server PC
    1.  $sudo apt-get install git-core gitk git-gui
  5. Install apache2 server on remote server PC which install sshd to connect other network PC
    1. $sudo apt-get install apache2
  6. Create git user on remote server machine
    1. Form your local PC, connect to remote server machine
      1. ssh user@remote-server-machine-ip
    2. $sudo adduser git
      1. You can create password for this. there is absolutely no problem with this
  7. Copy your public key to remote server machine
    1. Copy your public key ~/.ssh/id_ras.pub to ~/.ssh/your-name.pub
    2. $scp ~/.ssh/your-name.pub git@remote-server-machine-ip:~/.
  8. Login to git user of remote server machine
    1. $ssh  git@remote-server-machine-ip
    2. cd  /home/git
    3. cd ~ (to make sure that you are in git user home directory)
  9. Download and configure gitolite source
    1. git clone git://github.com/sitaramc/gitolite
    2. $cd gitolite
    3. gitolite$mkdir -p ~/bin ~/share/gitolite/conf ~/share/gitolite/hooks
    4. gitolite$src/gl-system-install ~/bin ~/share/gitolite/conf ~/share/gitolite/hooks
      1.  If you don’t find “gl-system-install” Just do below
        1. $cd /
        2. $locate gl-system-install
        3. copy gl-system-install to /home/git/gitolite/src/ and make sure the git user ownership
    5. gitolite$gl-setup your-name.pub
    6. This will open .gitolite.rc file
    7. If you need to change path then modify that and save it
    8. It will create “repositories” folder with two default git repo as below
      1. gitolite-admin
      2. testing
    9. Delete the your public key from git user home directory
      1. $cd ~    or     $ cd /home/git
      2. rm -rf your-name.pub
    10. Now verify that gitolite is configured properly as below
      1. From you local pc:
        1. $cd $WORKSPACE_PATH
        2. $git clone git@remote-server-machine-ip:gitolite-admin
          1. it clones the gitolite-admin repo into your local pc without asking any PASSWORD
  10. Download and configure gitweb
  11. Verify that everything works fine
  12. Enjoy your new git server 🙂
  13. Download latest gerrit installation from http://code.google.com/p/gerrit/downloads/list
 
4 Comments

Posted by on January 5, 2013 in Opensource & Embedded Systems

 

Tags: