Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1351853
  • 博文数量: 1334
  • 博客积分: 645
  • 博客等级: 上士
  • 技术积分: 5762
  • 用 户 组: 普通用户
  • 注册时间: 2012-07-25 16:56
文章分类

全部博文(1334)

文章存档

2014年(108)

2013年(1059)

2012年(169)

分类: LINUX

2013-06-13 13:21:43

1. gitweb安装
    注意:redhat的iso源是没有gitweb安装包,但是centos的源中有,在上一篇文章中给出了如何让redhat使用centos的源,那么,只需采用如下命令即可安装。

  1. # yum install gitweb
2. gitweb配置
  gitweb默认安装到了/var/www/git下,其配置文件在/etc/gitweb.conf下,另外,httpd的配置文件/etc/httpd/conf.d/git.conf。
(1)修改/etc/gitweb.conf

  1. $projectroot = "/var/www/git" //将projectroot修改为/var/www/git
(2)修改/etc/httpd/conf.d/git.conf

  1. Alias /git /var/www/git
  2. Allow from all
  3. AllowOverride all
  4. Order allow,deny
  5. Options +ExecCGI
  6. AddHandler cgi-script .cgi
  7. DirectoryIndex gitweb.cgi
  8. SetEnv GITWEB_CONFIG /etc/gitweb.conf
  9. Dav On
  10. RewriteEngine Off

(3)重启httpd
  1. /etc/init.d/httpd restart
(4)将gitosis仓库连接到/var/www/git下,完成web显示
  1. ln -s /home/git/repositories/test_repo.git /var/www/git/
(5)通过浏览器浏览

注意:  如果git clone  时出现git update-server-info错误,则在test_repos.git目录下执行 git update-server-info 命令即可(gitosis服务器的相应仓库下)。

3. 创建新的git repository
在git server的/home/git/repository目录下,执行如下命令:

  1. mkdir test.git
  2. cd test.git
  3. git init --bare
  4. //可以在这里添加源文件,也可以在client端clone之后添加


阅读(315) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~