OpenSUSE Tumbleweed下git instaweb报错:未找到对应项目
解决OpenSUSE Tumbleweed下git instaweb提示“No such projects found”的问题
以下是针对该问题的排查和解决步骤:
检查git instaweb配置
先查看当前全局或项目级的instaweb配置,确认参数是否正确:# 查看全局配置 git config --global --get-regexp instaweb # 查看当前项目配置 git config --local --get-regexp instaweb指定正确的gitweb配置文件
OpenSUSE中git-web的配置文件可能不在git instaweb默认查找路径,启动时手动指定:# 先找到gitweb.conf的位置 find / -name gitweb.conf # 用找到的路径启动instaweb git instaweb --httpd=lighttpd --conf=/path/to/gitweb.conf调整gitweb.conf中的项目根路径
编辑找到的gitweb.conf,确保$projectroot指向你的Git项目目录(比如你使用的/srv/git):$projectroot = "/srv/git";如果你的项目不是裸仓库,还需要添加以下配置,同时在每个项目根目录创建
git-daemon-export-ok空文件:$export_ok = "git-daemon-export-ok";修复目录权限
确保lighttpd运行用户(OpenSUSE中默认是wwwrun)能读取项目目录:chown -R wwwrun:www /srv/git chmod -R 755 /srv/git重启服务生效
先停止现有instaweb服务,再重新启动:git instaweb --stop git instaweb --httpd=lighttpd --conf=/path/to/gitweb.conf
内容的提问来源于stack exchange,提问作者Marcelo Roberto Jimenez
相关产品推荐
相关产品推荐

