Setting up and migrating Gitolite
My servers' purpose is usually downgraded to being a git server. Anything beyond that is just an addition. At the time of writing my go-to setup is using Gitolite to manage repositories and permissions.
For Gitolite to work, a completely fresh user is preferred. The user must have a home directory. Obviously there should be
git available. Additonally, have a public key ready.
Consider the following:
# apt install perl git
# 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 path/to/public-key.pub
At this point if you are not migrating from an old server (like I do almost each year) then you are done. Congratulations!
However, if you are migrating, then you should have a tarball prepared with
.gitolite.rc file and
repositories directory without the
gitolite-admin repository inside. You should also have the old
gitolite-admin cloned somewhere, ready to be used.
$ rm .gitolite.rc
$ tar xf migration.tar.gz
$ bin/gitolite setup
Once you have extracted, force push from the old clone:
$ cd gitolite-admin-old
$ git remote add fresh firstname.lastname@example.org:gitolite-admin
$ git push --force fresh