ubuntu9.0.4下安装配置git daemon V1.1

八月 9th, 2010 Posted in git | 阅读次数: 559 次

Author:gaojinbo
Time:2010-7-7

git有4种协议方式建git服务器,分别是本地协议、SSH协议、git协议和http协议。一般以http协议的方式提供git库的只读访问,对于日常工作提交,应以git方式为好,因为速度很快。Git版本控制工具的作者是Linux之父Linus Trovalds,最初是专门针对Linux内核开发的特点编写的,即协作人员异地分布、人数众多、项目规模巨大、复杂度高等。与常用的版本控制 CVS,Subversion等不同,它采用了分布式版本库的方式,不毕服务器断软件支持,使源代码的发布和维护极其方便。Git的本地查询、搜索,补丁制作、提交和应用,项目跟踪,分支合并等功能,可以大大提高开发效率,具有较强的灵活性。有人认为Git太艰涩难懂,实际上结合一些有用的脚本命令使用,会使其变得非常好用。Linux kernel、Wine、U-boot等著名项目都采用Git管理,ubuntu git,linux git

 

在这个文件基础上进行安装配置,hugwww-ubuntu9.0.4下安装配置git版本控制系统

1.安装git daemon
apt-get install git-daemon-run

 

2.修改配置文件
vi /etc/sv/git-daemon/run
最后一行,修改为:
exec chpst -ugit git daemon –verbose –export-all –base-path=/www/git/repositories/

 

3.启动服务
/etc/init.d/git-daemon start

 

4.查看进程
ps aux|grep git
root     17284  0.0  0.0    116    28 ?        Ss   09:16   0:00 runsv git-daemon
gitlog   17285  0.0  0.0    132    48 ?        S    09:16   0:00 svlogd -tt /var/log/git-daemon
git      19403  0.0  0.0  48680  1528 ?        S    10:39   0:00 git-daemon –verbose –export-all –base-path=/www/git/repositories/
root     19569  0.0  0.0   6264   732 pts/0    S+   10:45   0:00 grep git

 

5.访问仓库
git clone git://192.168.1.9/pbslib.git

通过以上5个步骤,就可以匿名只读访问所有git项目了

 

 

6.开通匿名读写权限
vi /etc/sv/git-daemon/run
最后一行,修改为:
exec chpst -ugit git daemon –verbose –enable=receive-pack –export-all –base-path=/www/git/repositories/

 

7.重启git daemon
/etc/init.d/git-daemon restart

 

git push如果出现错误
   1. errno=Connection refused 
   2. fatal: The remote end hung up unexpectedly 
errno=Connection refused
fatal: The remote end hung up unexpectedly

 

这是因为git-daemon命令缺少这几个参数:
–enable=upload-pack –enable=upload-archive –enable=receive-pack

 

 

 

问题:warning: git-daemon: unable to open supervise/ok: file does not exist

 

解决方法:
Doing this solves the problem:

sudo runsvdir /var/service &

After that, you can run:

sudo sv start git-daemon

 

 

完成!

相关日志:

Tags:

3 Responses to “ubuntu9.0.4下安装配置git daemon V1.1”

  1. June Says:

    学习了,谢谢
    自己搭一个git server,遇到困难,怎么都push不上去,感谢你的博客。


  2. Overcoming Panic Attacks Says:

    Recent Websites I Like…

    [...]here are some other links to sites that I link to because I think they are really worth visiting: http://www.panicattackstreatmentcure.net/links/…...


  3. Louis G Quartararo MD New Jersey Says:

    You should check this out…

    [...] Wonderful story, reckoned we could combine a few unrelated data, nevertheless really worth taking a look, whoa did one learn about Mid East has got more problerms as well [...]……


留下您的脚印