GitHub Repository Size Checker (Excluding .git)

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

اعتبارا من 17-04-2025. شاهد أحدث إصدار.

المؤلف
John Gray
التقييمات
0 0 0
الإصدار
1.0
تم إنشاؤه
13-04-2025
تم تحديثه
17-04-2025
Size
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

    • Click the "Install" badge above, or
    • Visit Greasy Fork

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