GitHub Repository Size Checker (Excluding .git)

Displays the actual code size in a GitHub repository (without .git).

当前为 2025-04-17 提交的版本,查看 最新版本

作者
John Gray
评分
0 0 0
版本
1.0
创建于
2025-04-13
更新于
2025-04-17
大小
18.6 KB
许可证
MIT
适用于

GitHub Repository Size Checker

Display accurate repository sizes on GitHub by calculating the total size of files (excluding .git directory) directly on repository pages.

Since GitHub only shows compressed repository sizes, this userscript helps developers better understand actual checkout sizes and project scope by querying the GitHub API.

Repository size display demo

Key Features

  • 📊 Accurate Size Display: Calculates total file size excluding .git directory
  • 🔄 API Integration: Uses GitHub API v3 for reliable data
  • 🔑 Secure Authentication: Requires GitHub Personal Access Token (PAT)
  • Performance Optimized:
    • 24-hour result caching
    • Commit SHA validation for cache freshness
  • 📝 User-Friendly: Human-readable size formats (B, KB, MB, GB)
  • ⚠️ Large Repo Support: Indicates approximate sizes with ~ for truncated results
  • ⚙️ Simple Setup: Easy PAT configuration via browser extension menu

Quick Start

  1. Get a Userscript Manager

  2. Install the Script

Setup

Generate GitHub PAT

  1. Navigate to GitHub Settings → Developer settings → Personal access tokens → Tokens (classic)
  2. Create new token (classic)
  3. Set note and expiration
  4. Select scope:
    • repo for all repositories
    • public_repo for public only
  5. Generate and copy token immediately

Configure Script

  • First Run: Enter PAT when prompted
  • Update PAT:
    1. Click userscript manager icon
    2. Select "GitHub Repository Size Checker"
    3. Choose "Set/Update GitHub PAT for Repo Size"
    4. Enter new PAT

Important Notes

  • UI Compatibility: Report issues if GitHub updates break display
  • Large Repositories: ~ prefix indicates approximate size due to API limits
  • Rate Limits: PAT provides 5000 requests/hour

Support

Issues and suggestions welcome at: https://github.com/yookibooki/userscripts/issues

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址