GitHub Repository Size Checker (Excluding .git)

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

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

您需要先安装一个扩展,例如 篡改猴Greasemonkey暴力猴,之后才能安装此脚本。

You will need to install an extension such as Tampermonkey to install this script.

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴Userscripts ,之后才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。

您需要先安装用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

作者
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

    • 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