For some reason, GitHub doesn't make it easy to see the repository size on its website. For personal accounts, you can go to Settings
(no, not the Repository Settings
, but your user settings) then click on Repositories
from the left navigation menu. This will list out the repositories and their corresponding sizes.
For GitHub Enterprise, there doesn't seem to be a similar list of repositories with their sizes. One way to get the repository size is to use the GitHub Repository API. First, unless your repository is public, create a Personal Access Token (PAT) with repo
permission that will be used for the API. Then, use Postman, Insomnia, curl, etc., to call the API for your repository using the following GET
request format and the authorization
header:
https://api.github.com/repos/[Organization Name]/[Repository Name] authorization: token [Personal Access Token]
Here's an example from one of my repositories – note the size
property:
Comparing the response and my repository list, seems like the unit of the size in KB.
If you're allowed to install Chrome Extensions, you can also try github-repo-size.
What about LFS? Well, you can look at it at the organization level as a whole in the Billing
setting, but at the repository level, you're out of luck, though there's an open feature request for it.
Of course, there are other ways to get repository and LFS sizes after you clone and such, but it would've been nice if GitHub made it easier to see them in the first place. Here's Bitbucket, in the main page for the repository settings:
(Note that there are two hosting options for GitHub Enterprise, on the cloud and on-prem. This post is about the cloud-hosted plan).