Mirror of the Rel4tion website/wiki source, view at <http://rel4tion.org>

[[ 🗃 ^yEzqv rel4tion-wiki ]] :: [📥 Inbox] [📤 Outbox] [🐤 Followers] [🤝 Collaborators] [🛠 Commits]

Clone

HTTPS: git clone https://vervis.peers.community/repos/yEzqv

SSH: git clone USERNAME@vervis.peers.community:yEzqv

Branches

Tags

master :: maint / admin / Git_Server /

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:

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:

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:

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
[See repo JSON]