How to install git daemon on Ubuntu 10.04

11.2k Views Asked by At

I'm sharing my repository on my

Linux nozim-desktop 2.6.32-24-generic #43-Ubuntu SMP Thu Sep 16 14:17:33 UTC 2010 i686 GNU/Linux

and I when I run:

sudo -u git git-daemon --base-path=/home/git/repositories/ --export-all

it says:

sudo: git-daemon: command not found

What I'm missing?

3

There are 3 best solutions below

0
On BEST ANSWER

In Ubuntu 12.04, the following line worked for me out of the box (execute it in the Git repository you want to share):

git daemon --export-all --base-path=$(pwd)

To clone the shared repository, use

git clone git://HOSTNAME/ REPOSITORY_NAME
# e.g., git clone git://my-machine/ test-project

Note that the/ after the hostname is required.

0
On
0
On

After encountering the same problem on my Ubuntu 10.04 system, I learned that git-daemon was just installed somewhere else and operated differently than the guide I followed on setting it up was expecting it to.

On my system, it was located at /us/lib/git-core/git-daemon

To use it, edit the file /etc/service/git-daemon/run/ and modify the parameters to suit your needs.

Here is mine:

#!/bin/sh
exec 2>&1
echo 'git-daemon starting.'
exec chpst -ugitdaemon /usr/lib/git-core/git-daemon --verbose --base-path=/home/git/repositories

If you want all of your repositories to be available publicly, add --export-all, otherwise, run touch git-daemon-export-ok within the /path/to/repositories/<repository-name>.git/ directory of the repositories you do want to be available publicly.

After making your changes, run ps -A | grep 'git' and then run a kill <process-id> to reload git-daemon with your new configuration.

Hope that helps!

Source: http://sharplearningcurve.com/blog/post/2010/02/06/Chasing-The-CI-Grail-e28093-Setup-Gitosis-From-Scratch.aspx ("Update Git-Daemon Configuration")