Search code examples
githubrepositorygithub-organizations

How to get the size of my organization repositories?


I am admin of a Github Organization and my storage is higher than the limit.

Storage limit

That's why I want to find the repositories that take the most storage and apply a fix.

The only way I found was clicking my avatar (top right) => Settings => Repositories. And here, I can see the size of them.

Repositories by size

However, this is only the repositories I HAVE PARTICIPATED IN, not all the repositories from my organization. So I tried to find the same page as my Organization but does not exists.

Not the same page as Organization

My question is : What is the easiest way to get the list of my organization's repositories by size ?

Thank you


Solution

  • Using the GitHub CLI, you can get the name and size in KB of the repos within the organization:

    gh repo list <my_org> --limit 999 --json name,diskUsage