如何在Ubuntu 10.04上安装git守护进程

时间:2011-04-01 12:06:56

标签: ubuntu git-daemon

我正在我的

上分享我的存储库
Linux nozim-desktop 2.6.32-24-generic #43-Ubuntu SMP Thu Sep 16 14:17:33 UTC 2010 i686 GNU/Linux

我跑的时候:

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

它说:

sudo: git-daemon: command not found

我缺少什么?

3 个答案:

答案 0 :(得分:5)

在我的Ubuntu 10.04系统上遇到同样的问题之后,我了解到git-daemon刚刚安装在其他地方并且操作方式与我在设置它时所遵循的指南有所不同。

在我的系统上,它位于/us/lib/git-core/git-daemon

要使用它,请编辑文件/etc/service/git-daemon/run/并修改参数以满足您的需求。

这是我的:

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

如果您希望公开提供所有存储库,请添加--export-all,否则,请在您希望公开提供的存储库的touch git-daemon-export-ok目录中运行/path/to/repositories/<repository-name>.git/。< / p>

完成更改后,请运行ps -A | grep 'git',然后运行kill <process-id>以使用新配置重新加载git-daemon

希望有所帮助!

来源: http://sharplearningcurve.com/blog/post/2010/02/06/Chasing-The-CI-Grail-e28093-Setup-Gitosis-From-Scratch.aspx(“更新Git-Daemon配置”)

答案 1 :(得分:3)

在Ubuntu 12.04中,以下行为我开箱即用(在你想要共享的Git存储库中执行它):

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

要克隆共享存储库,请使用

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

请注意,主机名后面的/是必需的。

答案 2 :(得分:1)

相关问题