Is there a way to get download/clone statistics of a git repository?

后端 未结 6 913
孤街浪徒
孤街浪徒 2020-12-09 00:42

Is there any way to get how many times a git repository has been cloned or downloaded from github? I was just curious as I found other statistics such as commit times lines

6条回答
  •  无人及你
    2020-12-09 01:20

    I just find out there is an even simpler way to get it with a single command using the github API.

    curl -u [username]:[password] https://api.github.com/repos/[owner]/[repo]/traffic/clones
    

    here:

    username  = your github id
    password  = your github password, optional. If not put in command, a password request would pop out.
    owner     = the owner of the repo, might be another name for a organized repo
    repo      = the repo name
    

    Have fun.

提交回复
热议问题