This very short tutorial assumes that you have already installed gitolite. Gitolite itself does not provide public read access; it always requires an SSH key. That’s where
is needed, it will allow to
git clone git://example.org/myRepository.git
Running the daemon
To run git-daemon as daemon on startup, install the
package. The daemon can then be started/stopped with:
then needs to be adjusted as described here:
- The git daemon has to be run as user which is also in the group
gitoliteto allow read access on gitolite’s repositories
- The path to the gitolite repository has to be corrected
Cloning will not work yet since the gitolite repositories are set to
. As described in the gitolite documentation the permissions for newly created files can be set in the .gitolite.rc file which is in gitolite’s home path, in this case at
As only new files will set to
now, the existing repositories which should be shared need to be updated.
Enabling sharing in gitolite
git-daemon only shares a repository if the file
is available in its root directory. You could create it using
, but a more elegant way is to do this via the gitolite-admin repository by giving the special user
read access. After pushing the changes to the server, gitolite will create the
For the error messages check the error log on the server at
, the most recent file is called
. The error message that is seen most frequently:
foo.git does not appear to be a git repository
This is usually a permission problem and can be fixed by following this tutorial closely. Especially check the following points:
- Are the file permissions for the repository to share correct?
- Is the user and group under which the daemon is being run correct? For this example: Is gituser in the gitolite group?
It may also be a path problem. For example, on debian the base-path seems to be set to
by default, where you usually do not have any git repository.
Client error message (no error message on the server):
This error message is shown when the connection fails. (Obviously.) Either because git-daemon is not running (check with
ps -e |grep git-daemon
on the server), or because it has been restarted without using the
The first can be solved by starting the daemon (
sv start git-daemon
), the second by adding the
flag and stopping and then starting the daemon again. You may have to wait for a minute or so first due to timeouts (see the daemon’s manpage).