如何找出谁删除了Gerrit中的分支

时间:2020-03-27 04:41:47

标签: git gerrit

在我们的Gerrit存储库中,有人删除了一个分支。有什么方法可以查看已删除该分支的人。本地reflog没有显示详细信息。

VonC,您好,我正试图通过https://gerrit-review.googlesource.com/Documentation/rest-api-projects.html#get-reflog来查找人员详细信息。

REST-API

但是显示以下错误。

curl -v -k -H "Authorization: user:<http-password>" -X GET https://gerrit-server/gerrit/projects/core/test-repo/branches/dev/reflog HTTP/1.0

1 个答案:

答案 0 :(得分:0)

mentioned before认为,仅Git不能提供足够的审计来发现谁推动了分支删除。

Gerrit本身提供了有限的审核功能(如Gerrit 2.12 and its Group audit log),或者,如OP所述,reflog

(也许正在访问Gerrit服务器侦听器(SSH或HTTPS服务器)的日志,您可以将可能的删除日期与某些网络访问日志进行协调,但这似乎可以解决。)

OP尝试:

 GET https://gerrit-server/gerrit/projects/core/test-repo/branches/dev/reflog

但是返回404,使用该API调用必须遵守:

GET /projects/{project-name}/branches/{branch-id}/reflog

It turned out是一个URL问题:

 curl --user user:<http-password> https://gerrit-server/gerrit/a/projects/core%2Ftest-repo/branches/dev/reflog

请注意/a/中的'gerrit-server/gerrit/a/projects/...':在OP的情况下似乎是强制性的。

相关问题