GIT服务器的管理。跟踪存储库克隆的过程 [英] Administration of GIT server. Track the process of repository cloning

查看:107
本文介绍了GIT服务器的管理。跟踪存储库克隆的过程的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何跟踪GIT服务器上存储库克隆的过程?我需要关于谁克隆仓库的信息。此外,我可以在哪里找到有关新存储库的数量和服务器上的数据库的信息?它需要进行统计。

How track the process of repository cloning on GIT server? I need information about who and when have cloned the repository. Furthermore where can I find the information about how much new repository were made and who did they on the server? It needs for making statistic.

推荐答案

正如本所述问题

As mentioned in this SO question:


克隆是一个只读操作,原始存储库不会被修改。您无法为统计数据提取简单的跟踪数据。

Cloning is a read-only operation, the original repository isn't modified. There is no way you can pull statistics for data that simply isn't tracked.

然而,这并非完全正确,在Git repo服务器上。

如果您只想跟踪一个特定的中央回购服务器的git操作(包括克隆),那么您可以添加一个授权层,如 Gitolite 会拦截任何git命令,检查您是否有权执行所述命令并执行它。

在执行之后,您可以添加自己的跟踪系统。

This isn't entirely true, however, depending on the Git repo server.
If you want to keep track of git operations (including cloning) only for one specific "central" repo server, then you can add an "authorization layer" like Gitolite which will intercept any git command, check if you are authorized to do said command, and execute it.
This is where you can, just after the execution, to add your own tracking system.

在同一台服务器上,您还可以扩展前端 gitlib 将这些统计信息(克隆)包含在回购统计信息屏幕中:

On that same server, you can also extend a front-end like gitlib to include those stats (clones) in the repo stats screen:

然而, :


  • 这些扩展名(wi th gitolite和gitlib)拦截 git clone 命令(与gitolite)和显示相关统计信息(gitlib)尚未实现。

    它们应该尽管如此,代码复杂。

  • 这不会(也不会)考虑所有其他的 git clone 其他 Git工作站上完成相同的回购。也就是说,一旦从您的主要中央Git repo服务器克隆,相同的repo可以在工作站之间多次克隆。您不会知道它。

  • Those extensions (with gitolite and gitlib) which would intercept the git clone command (with gitolite) and display associated stats (gitlib) are not yet implemented.
    They shouldn't be complex to code, though.
  • this doesn't (and will not) take into account all the other git clone done for that same repo on other Git workstation. Ie, once cloned from your main "central" Git repo server, that same repo can be cloned again many time from workstation to workstation. You won't know it.

这篇关于GIT服务器的管理。跟踪存储库克隆的过程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆