install git server on ubuntu

first create the pub key for current user
generated key is in /home/me/.ssh/
now copy it to /tmp
cp /home/me/.ssh/ /tmp/

sudo apt-get install install git, git-daemon-run

create a new user “git”
sudo adduser \
–system \
–shell /bin/bash \
–gecos ‘git version control’ \
–group \
–disabled-password \
–home /home/git \

now as user git
sudo su git
git clone git://
mkdir -p $HOME/bin
gitolite/install -to $HOME/bin
$home/bin/gitolite setup -pk /tmp/
now back to regular user “me”
cd $home
git clone git@ubuntu:gitolite-admin
cd gitolite-admin
cd conf
vi gitolite.conf
here you can add repository, change the allowed user
save the file
git add .
git commit -m ‘update conf’
git push origin master

to add a new user
cd /home/me/gitolite-admin/keys
copy/paste the public key
git add/commit/push

on windows can use sysgit
it can generate keys for you

on eclipse to use remote git server
first make sure to have the keys in c:/users/me/.ssh
add a file “config” in .ssh directory

Host ubuntu
HostName ubuntu
User git
PreferredAuthentications publickey
IdentityFile ~/.ssh/id_rsa

(here ‘ubuntu’ is the host name of the remote server, you may add to the /windows/system32/driver/etc/host file)

or through
ecpise-> preferences -> networking -> ssh2


Leave a Reply

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

You are commenting using your 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