Mirror of the Rel4tion website/wiki source, view at <http://rel4tion.org>
Clone
HTTPS:
git clone https://vervis.peers.community/repos/yEzqv
SSH:
git clone USERNAME@vervis.peers.community:yEzqv
Branches
Tags
Gitolite_Setup.mdwn
Install the ‘gitolite’ package using your favorite package manager from the Debian repositories. It should require ‘git’ and ‘openssh-server’ and several other packages as dependencies (unless they are already installed). On the command-line this can be done by running the following command as root:
# apt-get install gitolite
When installing gitolite, debconf basically should prompt the user for several settings. However, due the a bug in the stable package, it doesn’t happen automatically. If it did work for you when you installed the package - great. Otherwise, run the configuration program (as root) after the ‘gitolite’ package is installed:
# dpkg-reconfigure gitolite
The first setting you’ll be asked to choose is the name of the user which gitolite will use to access the repositories. It can be any user, but it is safer to use a separate user. If the specified user doesn’t exist, it will be automatically created.
The default user is gitolite, but personally I prefer to decouple general git server details from the specific management software I use (gitolite is not the only one of its kind). Thus, since the gitolite user is the owner of the git repositories, I give it the name git. This is also seems to be the name used commonly for this purpose in other places.
The second setting you need to fill in is the path where the repositories will be stored. This will also be the gitolite user’s home directory. The default, /var/lib/gitolite, may be fine for many cases, but you should probably take the following into consideration:
- Disk encryption: If you don’t use a single disk partition for your whole file system, your home directory and the file system root (whose path is /) probably reside in different partitions. It is common to have the home partition encrypted while the root partition is not, so take that into account when choosing the path. This has an implication on anonymity: If you host your repositories on a darknet or in any other anonymous mechanism, storing them on an encrypted partition may prevent 3rd parties from figuring out who you are in case they file your lost harddrive. Otherwise it probably doesn’t make a big difference, because your code is going to be available via your new git server anyway.
- Available space: For the same reason explained above, it is common for home computers to have a large home partition and a smaller root partition (e.g. 300 GB home partition and 25 GB root partition). Files stored in version control are usually relatively small, i.e. they aren’t binaries (executables, audio, video), but as repositories grow and new ones are added, this may become a consideration.
- For the same reason I prefer git as the name of the user, I prefer to not have ‘gitolite’ in the path of the repositories.
Note that it is possible to use /var/lib/gitolite (or any other path) and simply make it a symbolic link which points to the real location of the repositories.
Some common options are:
- /var/lib/gitolite
- /home/git
- /opt/git
- /srv/git
For details on the purpose of the various folders, you can read about the Filesystem Hierarchy Standard (FHS).
For the purpose of the example, let’s use /home/git. The repositories themselves will be stored under a subfolder /home/git/repositories created for you automatically.
The third and last thing you’ll be asked is the SSH key of the administator. When gitolite is installed on a dedicated server, its configuration is usually done by connecting to it via SSH from a workstation, e.g. a personal computer of the developer. The SSH key specified should be the key of the person who will be in charge of managing the repositories and gitolite’s configuration files. For example, it may be the lead developer or a system administrator or someone in the team who is hosting the server.
In my case, the same computers multi-function as servers and as user desktops, so I use my personal SSH key. If the key needs to be sent over to the server from a remote location, e.g. a personal workstation, you can leave the setting empty and configure gitolite manually. [[TODO|TODO/OPEN]]
A personal SSH key is commonly stored in your home folder, under the .ssh hidden folder. This folder usually contains the key as a pair of files:
- /home/alice/.ssh/id_rsa
- /home/alice/.ssh/id_rsa.pub
The first file is your private key, which you should never give to anyone or send anywhere. The second file is the public key, and this is what you need to put on the server. If the server runs on your own computer, the key setting can be the path to the public key: /home/alice/.ssh/id_rsa.pub.
After the last setting has been entered, the following message will be presented in the terminal:
creating gitolite-admin...
Initialized empty Git repository in /home/git/repositories/gitolite-admin.git/
creating testing...
Initialized empty Git repository in /home/git/repositories/testing.git/
[master (root-commit) 5bd9b40] start
2 files changed, 6 insertions(+)
create mode 100644 conf/gitolite.conf
create mode 100644 keydir/admin.pub