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