1

我正在努力通过 git review 命令将更改推送到 Gerrit。

到目前为止,我已经执行了以下步骤:

  1. 根据官方文档在我的本地电脑上安装了 Gitblit 服务器。

  2. 按照本教程安装 Gerrit 。

现在,为了推送更改以供审核,我执行了以下操作。

git clone http://admin@localhost:8008/r/testrepo.git

修改了一些文件

git add .
git commit -m 'my_trial_commit'

到目前为止一切正常,但是当我运行git review -R提交新更改以供审核时,我收到以下错误。

git review -R
To http://localhost:8008/r/testrepo.git
! [remote rejected] HEAD -> refs/for/master (testrepo.git is not configured to receive patchsets)
error: failed to push some refs to 'http://admin@localhost:8008/r/testrepo.git'
4

2 回答 2

0

似乎您正在推动 GitBlit,而不是 Gerrit,因为错误来自GitBlit code。再试一次,推送到 Gerrit HTTP 或 SSH 端口。

另外,为什么是 GitBlit?推荐(和支持)的代码存储库浏览器是Gitiles(自 3.0 起作为核心插件包含在内)。

于 2019-10-01T11:49:52.223 回答
0

如果您需要单独的代码托管(虽然我同意 Gert,但使用 gitiles 会更容易)......那么您可能需要将 .gitreview 文件添加到您的存储库中。.gitreview 文件可以指向 gerrit 服务器。例如:

https://opendev.org/zuul/zuul/src/branch/master/.gitreview

[gerrit]
host=review.opendev.org
port=29418
project=zuul/zuul.git

是 zuul gitreview 文件 - 它允许从https://opendev.org/zuul/zuul克隆 zuul - 但让 git-review 知道 zuul 的 gerrit 位于 review.opendev.org。

于 2019-10-01T13:20:54.763 回答