注意:redhat的iso源是没有gitweb安装包,但是centos的源中有,在上一篇文章中给出了如何让redhat使用centos的源,那么,只需采用如下命令即可安装。
- # yum install gitweb
gitweb默认安装到了/var/www/git下,其配置文件在/etc/gitweb.conf下,另外,httpd的配置文件/etc/httpd/conf.d/git.conf。
(1)修改/etc/gitweb.conf
- $projectroot = "/var/www/git" //将projectroot修改为/var/www/git
- Alias /git /var/www/git
- /etc/init.d/httpd restart
- ln -s /home/git/repositories/test_repo.git /var/www/git/
(5)通过浏览器浏览
http://xxxx/git/
注意: 如果git clone http://xxx/git/test_repo.git时出现git update-server-info错误,则在test_repos.git目录下执行 git update-server-info 命令即可(gitosis服务器的相应仓库下)。
3. 创建新的git repository
在git server的/home/git/repository目录下,执行如下命令:
- mkdir test.git
- cd test.git
- git init --bare
- //可以在这里添加源文件,也可以在client端clone之后添加