How to get the size of my organization repositories?
Asked Answered
N

3

5

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

Newfangled answered 9/5, 2022 at 10:9 Comment(1)
I have this very same question. I tried adding myself as a member of my own repositories (if that makes sense). But no joy ...Bloomers
B
6

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
Banish answered 13/7, 2022 at 8:30 Comment(1)
What is gh? It is this cli.github.comTuff
J
2

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}'
Jaquez answered 11/6, 2023 at 9:44 Comment(1)
add ' please at the endThereof
G
2

Or you can get a single repository size:

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

Goose answered 28/8, 2023 at 20:25 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.