You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

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

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.03 01:38:14