This article is a mirror article of machine translation, please click here to jump to the original article.

View: 3127|Reply: 0

GitHub uses the REST API to view repository sizes

[Copy link]
Posted on 10/6/2023 11:03:27 AM | | | |
Requirements: For relatively large projects, it may take a long time to clone it, and you want to know the size of the repository and let yourself evaluate whether to download it.

Download large projects using Git shallow clone source code
https://www.itsvse.com/thread-10451-1-1.html

GitHub REST API documentation:The hyperlink login is visible.

Request restrictions: For unauthenticated requests, the rate limit allows up to 60 requests per hour. User access token requests are limited to 5,000 requests per authenticated user per hour.

Repository interface documentation:The hyperlink login is visible.

Get warehouse information:https://api.github.com/repos/{owner}/{repo}, replace {owner} and {repo} with the corresponding items, for example:

https://api.github.com/repos/itsvse/Dapper.Contrib


When retrieving information about the repository, the attribute namedsizeThe value is the size of the entire repository, including all of its history (In KB kilobytes)。 (But it's not the exact right size for the repository)

If you want to see the size of the repositories under your account, you can visit:The hyperlink login is visible., as shown in the figure below:



(End)





Previous:.NET/C# new feature record type
Next:CentOS Linux alternatives Rocky Linux, AlmaLinux
Disclaimer:
All software, programming materials or articles published by Code Farmer Network are only for learning and research purposes; The above content shall not be used for commercial or illegal purposes, otherwise, users shall bear all consequences. The information on this site comes from the Internet, and copyright disputes have nothing to do with this site. You must completely delete the above content from your computer within 24 hours of downloading. If you like the program, please support genuine software, purchase registration, and get better genuine services. If there is any infringement, please contact us by email.

Mail To:help@itsvse.com