Go back ⮌

Installing Gitolite

First service we will install and configure on our server is Gitolite. That is mainly because my server’s purpose is usually downgraded to being a git server. Anything beyond that is just an addition. For Gitolite to work, we will need a clean user with home directory and already installed packages including perl and git. Place your public key in home directory of gitolite user.

adduser --disabled-password --gecos "" git
su - git
mkdir -p ~/bin
git clone https://github.com/sitaramc/gitolite
gitolite/install -ln /home/git/bin
bin/gitolite setup -pk key.pub

At this point if you are not migrating from an old server then you can simply skip to next section. If you are migrating from old server then you should have tarball prepared with .gitolite.rc file and repositories directory with gitolite-admin repo removed. You should also have gitolite-admin cloned somewhere and be able to use it.

rm .gitolite.rc
tar xf migration.tar.gz
bin/gitolite setup

I shall repeat: extracting data from old server should not overwrite local gitolite-admin repository! Once you have extracted force push from clone.

cd gitolite-admin-clone
git remote add fresh git@example.com:gitolite-admin
git push -f fresh

Congratulations, we have just made one thing work (the easiest one)!

External resources