gitweb
Gitweb实际上是用perl写的CGI脚本,一般都是在Apache中使用。在Gerrit中,它也可以直接被调用转换成HTML显示。这样可以方便在服务器网页端直接查看服务器代码。
在Gerrit中使用gitweb来浏览版本库,可以参考gerrit帮助手册中Gerrit Code Review- Gitweb Integration章节。我简要总结下操作步骤:
确保安装git时安装了gitweb;
找出gitweb.cgi所在路径(如/var/www/git/gitweb.cgi);
修改gerrit配置文件gerrit.config,可以手动输入:
[gitweb] cgi = /var/www/git/gitweb.cgi
也可以通过命令配置 git config –file $site_path/etc/gerrit.config gitweb.cgi /var/www/git/gitweb.cgi
重启gerrit服务,再通过web登录后,就会发现在Projects中多出gitweb的链接。
PS
通过修改gitweb\static\gitweb.css文件中的.cntrl { display: none; } ,可以暂时解决“代码显示换行时会把\r显示出来”的问题
转载请注明原文地址: https://ju.6miu.com/read-39757.html