Based on Ubuntu 14.04
In order not to pay Github for keeping repo private, I built a git server on my VPS. The following is how I did that.
sudo apt-get install gitolitesudo adduser --system --shell /bin/bash --group --disabled-password --home /home/git gitssh-keygen -t rsasudo su - git<br></br>
gl-setup /tmp/id_rsa.pub```
5. For now, gitolite is all set for me but only me. In order to add other users, I need to clone gitolite-admin.git to the administrator host(these are supposed to be operated under the administrator host and administrator user):
git clone git@$IP_ADDRESS:gitolite-admin.git
cd gitolite-admin```
To add a new user, put new user’s pub SSH key into gitolite-admin/keydir/, then commit and push the gitolite-admin repo.
To add a repo, append new repo info into gitolite-admin/conf/gitolite.conf then commit and push the gitolite-admin repo, before push the new repo to the server.