How to get the size of my organization repositories?

2.7k Views Asked by At

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

3

There are 3 best solutions below

0
On BEST ANSWER

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
1
On

The following might be handy to view the size in MBs

$ gh repo list <org_name> --limit 999 --json name,diskUsage | jq '.[] | .diskUsage = (.diskUsage / 1024) | {name: .name, diskUsage: .diskUsage}'
0
On

Or you can get a single repository size:

gh repo view <org>/<repo> --json diskUsage