Skip to content

Instantly share code, notes, and snippets.

@dingzeyuli
Created December 16, 2016 22:34
Show Gist options
  • Star 47 You must be signed in to star a gist
  • Fork 10 You must be signed in to fork a gist
  • Save dingzeyuli/f07c126b74371adba4b7dbe181cb57d2 to your computer and use it in GitHub Desktop.
Save dingzeyuli/f07c126b74371adba4b7dbe181cb57d2 to your computer and use it in GitHub Desktop.
Check the size of a github repo before downloading
# http://webapps.stackexchange.com/questions/39587/view-estimated-size-of-github-repository-before-cloning
# tested on macOS
echo https://github.com/torvalds/linux.git | perl -ne 'print $1 if m!([^/]+/[^/]+?)(?:\.git)?$!' | xargs -I{} curl -s -k https://api.github.com/repos/'{}' | grep size
# output:
# "size": 1746294,
@prajwal89
Copy link

prajwal89 commented Oct 19, 2023

I've developed a tool for checking GitHub repository sizes by leveraging the GitHub API.
You can find the tool here:
GitHub Repository Size Checker

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment