RSS

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

05 Jan

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
About these ads
 
4 Comments

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

 

Tags:

4 responses to “Git server with gitolite,gitweb and gerrit integration on linux ubuntu 10.04/12.04

  1. Paulo Pires

    January 30, 2013 at 6:36 pm

    Where’s Gerrit? :-s

     
  2. Olivier Billard

    February 27, 2013 at 2:59 pm

    Hi,
    And how did you put gerrit over gitolite ?
    This information is missing..

     
  3. Eric

    June 5, 2013 at 2:31 am

    Dude! What about the Gerrit part promised in the article title?

     
  4. Hardik Patel

    June 11, 2013 at 3:30 am

    Hi All,

    I was bit busy. I will update soon. thanks

     

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
Follow

Get every new post delivered to your Inbox.

%d bloggers like this: