Administration of GIT server. Track the process of repository cloning

瘦欲@ 提交于 2020-01-02 05:43:08

问题


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.


回答1:


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.

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.

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

However:

  • 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.


来源:https://stackoverflow.com/questions/9778786/administration-of-git-server-track-the-process-of-repository-cloning

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!