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

如何在Ubuntu 10.04上安装git守护程序,ubuntu,git-daemon,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 Linux nozim desktop 2.6.32-24-generic#43 Ubuntu SMP周四9月16日14:17:33 UTC 2010 i686 GNU/Linux 当我跑步时,我会: sudo -u git git-daemon --base-path=

我正在我的计算机上共享我的存储库

Linux nozim-desktop 2.6.32-24-generic #43-Ubuntu SMP Thu Sep 16 14:17:33 UTC 2010 i686 GNU/Linux Linux nozim desktop 2.6.32-24-generic#43 Ubuntu SMP周四9月16日14:17:33 UTC 2010 i686 GNU/Linux 当我跑步时,我会:

sudo -u git git-daemon --base-path=/home/git/repositories/ --export-all sudo-u git-git守护进程--基本路径=/home/git/repositories/--导出所有 它说:

sudo: git-daemon: command not found sudo:git守护进程:未找到命令
我缺少什么?

在我的Ubuntu 10.04系统上遇到同样的问题后,我了解到git daemon只是安装在其他地方,运行方式与我在设置它时遵循的指南所期望的不同

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

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

这是我的:

#/bin/sh
执行2>&1
回显“git守护进程正在启动”。
执行chpst-ugitdaemon /usr/lib/git-core/git-daemon--verbose--base-path=/home/git/repositories

如果希望所有存储库都可以公开使用,请添加
--export all
,否则,在您希望公开使用的存储库的
/path/to/repositories/.git/
目录中运行
触摸git daemon export ok

进行更改后,运行
ps-A | grep'git'
,然后运行
kill
以使用新配置重新加载
git守护程序

希望有帮助

来源:(“更新Git守护程序配置”)

看看


它解决了我的问题。

在Ubuntu12.04中,下面这行代码对我来说是开箱即用的(在您想要共享的Git存储库中执行):

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

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

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

谢谢,我会尽快尝试:)
git clone git://HOSTNAME/ REPOSITORY_NAME
# e.g., git clone git://my-machine/ test-project