Publishing Git repositories on a shared server

So you are the happy admin or user of a shared Linux server. You know that Git is very cool, and you want to install what's necessary on the shared server to host user repositories there. You're like me: you've read some Git documentation, but you just haven't found some sort of executive summary comprehensively listing how to do that. I hope this place will help!

Normally, any server on which users may login and have a personal web space, and core git binaries are installed, is sufficient for publishing git repositories, without any server admin task involved; however, what's proposed here results in a more formal repositories handling on the shared server, allowing a global view of all hosted repositories and unified management, and more cool git repository URLs using the native git protocol.

One time installation on the shared server

If you wanted to have the base project directory elsewhere from default /pub/git, you'd have to set the location as $projectroot in /etc/gitweb.conf and amend @git_base_url_list, and as --base-path to git-daemon in the xinetd configuration.

Create a new repository for a user

A user tells an admin he'd like to have a new repository created for him.

We suppose the data for the repositories will live in the user directories, using symlinks from the base project directory, so that repository data live within user quotas. In the following examples, you may wish to rather have files in the base project directory if no user quota is enforced/wanted.

Basic usage for a user

This is really provided "as-is". Use it as a first-time demo or a very limited handbook. There are plenty of better usage docs on the web.

Guillaume Cottenceau
Last modification: Fri Nov 5 17:39:40 2010