Gerrit 2.12.x无法view diff

安装配置好gerrit之后,push完代码之后,无法打开每一个非工程根目录下的文件进行view。

报错如下:

The page you requested was not found, or you do not have permission to view this page.


原因是因为:

(源自:https://bugs.chromium.org/p/gerrit/issues/detail?id=3081&q=The%20page%20you%20requested%20was%20not%20found%2C%20or%20you%20do%20not%20have%20permission%20to%20view%20this%20page.&colspec=ID%20Type%20Stars%20Milestone%20Status%20Priority%20Owner%20Summary

https://review.cyanogenmod.org/Documentation/config-reverseproxy.html#_apache_2_configuration)


To run Gerrit behind an Apache server using 'mod_proxy', enable thenecessary Apache2 modules:

  a2enmod proxy_http
  a2enmod ssl          ; # optional, needed for HTTPS / SSL

Configure an Apache VirtualHost to proxy to the Gerrit daemon,setting the 'ProxyPass' line to use the 'http://' URL configuredabove. Ensure the path of ProxyPass and httpd.listenUrl match,or links will redirect to incorrect locations.

	<VirtualHost *>
	  ServerName review.example.com

	  ProxyRequests Off
	  ProxyVia Off
	  ProxyPreserveHost On

	  <Proxy *>
	    Order deny,allow
	    Allow from all
	  </Proxy>

	  AllowEncodedSlashes On
	  ProxyPass /r/ http://127.0.0.1:8081/r/ nocanon
	</VirtualHost>

The two options 'AllowEncodedSlashes On' and 'ProxyPass .. nocanon' are required since Gerrit 2.6.


Gerrit是一个用于代码审查的开源平台,而Git LFS(Large File Storage)则是一个用于管理大文件存储的工具,比如二进制文件或媒体文件。在Gerrit 2.15.20版本中安装Git LFS插件通常涉及几个步骤: 1. **确认环境准备**: - 确保已经安装了Git和Git LFS,因为Gerrit依赖它们。 2. **添加Git LFS到Gerrit仓库**: 在你的Gerrit服务器上,找到`gerrit.config`配置文件,打开它并添加对Git LFS的引用。通常会在`[httpd]\listenUrl`下面添加类似这样的行: ``` [httpd] enableGitLfs = true gitlfsInstallPath = /path/to/install/git-lfs ``` 其中`/path/to/install/git-lfs`是你想要安装Git LFS的路径。 3. **下载并安装Git LFS客户端**: - 访问Git LFS的官方网站 https://git-lfs.github.com/ 下载适合当前操作系统的二进制包。 - 解压安装包并移动Git LFS命令到系统PATH中,例如: ```bash sudo mv /path/to/downloaded/git-lfs /usr/local/bin sudo chmod +x /usr/local/bin/git-lfs ``` 4. **初始化Git LFS**: 使用管理员权限运行Gerrit,然后执行初始化命令以配置Git LFS支持: ```bash sudo gerrit init --batch && gerrit update-init --enable-git-lfs ``` 5. **重启Gerrit服务**: 完成上述步骤后,别忘了重启Gerrit服务以应用更改: ```bash sudo service gerrit restart ``` 6. **验证安装**: 你可以通过访问Gerrit的Web界面,在项目的设置中检查是否能看到Git LFS选项,以及能否正常上传和下载大文件。
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值