Quantcast
Channel: User Schwern - Stack Overflow
Viewing all articles
Browse latest Browse all 581

Answer by Schwern for How to find all the commits of an organization in github?

$
0
0

A faster option might be to use the Github API to list all public repositories of an organization. For each repository only clone the commits using git clone --filter=object:type=commit. Then use git to examine the commits.

Here's some pseudo code to explain how to count every commit in an organization.

num_commits = 0for repo in org.repos  git clone --filter=object:type=commit repo.url  cd into repo  num_commits += git rev-list --all --count

This has the potential to be very efficient because the commit objects are very small and cloning is very efficient. Much more efficient than paging through every commit with a JSON API.


Viewing all articles
Browse latest Browse all 581

Trending Articles