重要前提
安装AI Skills的关键前提是:必须科学上网,且开启TUN模式,这一点至关重要,直接决定安装能否顺利完成,在此郑重提醒三遍:科学上网,科学上网,科学上网。查看完整安装教程 →
git-2-49-features by josiahsiegel/claude-plugin-marketplace
npx skills add https://github.com/josiahsiegel/claude-plugin-marketplace --skill git-2-49-features功能: 使用路径遍历 API 高效下载部分克隆中缺失的对象。
优势: 在从部分克隆中获取对象时,显著改进增量压缩,从而减少下载量并提升性能。
# 检查是否为部分克隆
git config extensions.partialClone
# 在后台下载缺失的对象
git backfill
# 使用自定义批量大小下载
git backfill --batch-size=1000
# 遵循稀疏检出模式(仅获取需要的文件)
git backfill --sparse
# 检查进度
git backfill --verbose
场景 1:使用 --filter=blob:none 克隆后
# 克隆时不包含 blob 对象
git clone --filter=blob:none https://github.com/large/repo.git
cd repo
# 之后,高效预取所有缺失的对象
git backfill
场景 2:稀疏检出 + 部分克隆
# 结合两种优化进行克隆
git clone --filter=blob:none --sparse https://github.com/monorepo.git
cd monorepo
git sparse-checkout set src/api
# 仅获取所需对象
git backfill --sparse
场景 3:CI/CD 优化
# 在 CI 流水线中 - 仅获取所需内容
git clone --filter=blob:none --depth=1 repo
git backfill --sparse
# 比完整克隆快得多
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
传统的部分克隆获取方式:
git fetch --unshallow
# 以随机顺序下载 500MB
# 增量压缩效果差
使用 git-backfill:
git backfill
# 通过优化的增量压缩下载 150MB(减少 70%)
# 按路径分组对象以获得更好的压缩效果
功能: 一个内部 API,将出现在相同路径的对象分组在一起,从而实现更好的增量压缩。
工作原理: 路径遍历不是按提交顺序处理对象,而是按文件系统路径处理,使得 Git 能找到更好的增量基准。
优势:
以下情况会自动受益:
git backfillgit repack (2.49 版本已改进)# 用于 repack 操作
git config pack.useBitmaps true
git config pack.writeBitmaps true
# 使用路径遍历优化进行重新打包
git repack -a -d -f
# 检查改进效果
git count-objects -v
功能: Git 2.49 通过集成 zlib-ng 提升了压缩/解压缩性能。
优势:
自动改进以下操作:
git clonegit fetchgit pushgit gcgit repack功能: 改进了增量压缩期间选择对象对的算法。
结果:
自动生效 - 无需操作。
功能: Git 2.49 为 Git 的内部库添加了 Rust 绑定 (libgit-sys 和 libgit-rs)。
相关性: 未来的 Git 工具和性能改进将利用 Rust 的内存安全性和性能优势。
对于开发者: 您现在可以使用官方绑定在 Rust 中构建 Git 工具。
功能: 服务器现在可以向客户端通告承诺者远程信息。
优势:
配置:
# 查看承诺者远程信息
git config remote.origin.promisor
git config extensions.partialClone
# 验证承诺者包文件
ls -lah .git/objects/pack/*.promisor
# 以最高效率克隆大型单仓库
git clone --filter=blob:none --sparse https://github.com/company/monorepo.git
cd monorepo
# 仅检出您团队的服务
git sparse-checkout set --cone services/api
# 使用路径遍历优化获取所需对象
git backfill --sparse
# 结果:比完整克隆小 95%,下载速度快 70%
# .github/workflows/ci.yml
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: 使用优化检出
run: |
git clone --filter=blob:none --depth=1 --sparse ${{ github.repositoryUrl }}
cd repo
git sparse-checkout set src tests
git backfill --sparse
- name: 运行测试
run: npm test
# 比 CI 中的完整克隆快 80%
# 克隆具有庞大历史记录的仓库
git clone --filter=blob:none https://github.com/project/with-long-history.git
cd with-long-history
# 仅处理近期代码(对象按需获取)
git checkout -b feature/new-feature
# 当需要完整历史记录时
git backfill
# 为优化存储重新打包
git repack -a -d -f # 使用路径遍历 API
⚠️ 现已正式弃用:
.git/branches/ 目录(请改用 remotes).git/remotes/ 目录(请改用 git remote 命令)迁移方法:
# 如果您有旧式远程配置,请转换它们
# 检查已弃用的目录
ls -la .git/branches .git/remotes 2>/dev/null
# 使用现代远程配置
git remote add origin https://github.com/user/repo.git
git config remote.origin.fetch '+refs/heads/*:refs/remotes/origin/*'
功能: 继续开发 Meson 作为 Git 的替代构建系统。
原因: 构建速度更快,跨平台支持更好。
状态: 实验性 - 生产环境请使用 make。
功能: HTTP 传输现在支持使用 .netrc 进行身份验证。
用法:
# ~/.netrc
machine github.com
login your-username
password your-token
# Git 现在会自动使用这些凭据
git clone https://github.com/private/repo.git
对部分克隆使用 git-backfill:
git backfill --sparse # 优于 git fetch --unshallow
组合优化:
git clone --filter=blob:none --sparse <url> git sparse-checkout set --cone <paths> git backfill --sparse
定期维护:
git backfill # 填充缺失的对象 git repack -a -d -f # 使用路径遍历进行优化 git prune # 清理
监控部分克隆状态:
git config extensions.partialClone
# 列出缺失的对象
git rev-list --objects --all --missing=print | grep "^?"
5. 迁移已弃用的特性:
# 弃用 .git/branches 和 .git/remotes
# 改用 git remote 命令
找不到 git-backfill 命令:
# 验证 Git 版本
git --version # 必须为 2.49+
# 更新 Git
brew upgrade git # macOS
apt update && apt install git # Ubuntu
承诺者远程问题:
# 重置承诺者配置
git config --unset extensions.partialClone
git config --unset remote.origin.promisor
# 重新启用
git config extensions.partialClone origin
git config remote.origin.promisor true
增量压缩效果不佳:
# 强制使用路径遍历优化重新打包
git repack -a -d -f --depth=250 --window=250
每周安装量
64
代码仓库
GitHub 星标数
21
首次出现
2026 年 1 月 24 日
安全审计
安装于
claude-code50
gemini-cli49
opencode49
codex47
cursor45
github-copilot42
What: Efficiently download missing objects in partial clones using the path-walk API.
Why: Dramatically improves delta compression when fetching objects from partial clones, resulting in smaller downloads and better performance.
# Check if you have a partial clone
git config extensions.partialClone
# Download missing objects in background
git backfill
# Download with custom batch size
git backfill --batch-size=1000
# Respect sparse-checkout patterns (only fetch needed files)
git backfill --sparse
# Check progress
git backfill --verbose
Scenario 1: After cloning with --filter=blob:none
# Clone without blobs
git clone --filter=blob:none https://github.com/large/repo.git
cd repo
# Later, prefetch all missing objects efficiently
git backfill
Scenario 2: Sparse-checkout + Partial clone
# Clone with both optimizations
git clone --filter=blob:none --sparse https://github.com/monorepo.git
cd monorepo
git sparse-checkout set src/api
# Fetch only needed objects
git backfill --sparse
Scenario 3: CI/CD Optimization
# In CI pipeline - fetch only what's needed
git clone --filter=blob:none --depth=1 repo
git backfill --sparse
# Much faster than full clone
Traditional partial clone fetch:
git fetch --unshallow
# Downloads 500MB in random order
# Poor delta compression
With git-backfill:
git backfill
# Downloads 150MB with optimized delta compression (70% reduction)
# Groups objects by path for better compression
What: Internal API that groups together objects appearing at the same path, enabling much better delta compression.
How it works: Instead of processing objects in commit order, path-walk processes them by filesystem path, allowing Git to find better delta bases.
Benefits:
You benefit automatically when using:
git backfillgit repack (improved in 2.49)# For repack operations
git config pack.useBitmaps true
git config pack.writeBitmaps true
# Repack with path-walk optimizations
git repack -a -d -f
# Check improvement
git count-objects -v
What: Git 2.49 includes improved performance through zlib-ng integration for compression/decompression.
Benefits:
Automatically improves:
git clonegit fetchgit pushgit gcgit repackWhat: Improved algorithm for selecting object pairs during delta compression.
Results:
Automatic - no action needed.
What: Git 2.49 added Rust bindings (libgit-sys and libgit-rs) for Git's internal libraries.
Relevance: Future Git tooling and performance improvements will leverage Rust for memory safety and performance.
For developers: You can now build Git tools in Rust using official bindings.
What: Servers can now advertise promisor remote information to clients.
Benefits:
Configuration:
# View promisor remote info
git config remote.origin.promisor
git config extensions.partialClone
# Verify promisor packfiles
ls -lah .git/objects/pack/*.promisor
# Clone large monorepo with maximum efficiency
git clone --filter=blob:none --sparse https://github.com/company/monorepo.git
cd monorepo
# Only checkout your team's service
git sparse-checkout set --cone services/api
# Fetch needed objects with path-walk optimization
git backfill --sparse
# Result: 95% smaller than full clone, 70% faster download
# .github/workflows/ci.yml
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout with optimizations
run: |
git clone --filter=blob:none --depth=1 --sparse ${{ github.repositoryUrl }}
cd repo
git sparse-checkout set src tests
git backfill --sparse
- name: Run tests
run: npm test
# 80% faster than full clone in CI
# Clone repository with massive history
git clone --filter=blob:none https://github.com/project/with-long-history.git
cd with-long-history
# Work on recent code only (objects fetched on demand)
git checkout -b feature/new-feature
# When you need full history
git backfill
# Repack for optimal storage
git repack -a -d -f # Uses path-walk API
⚠️ Now Officially Deprecated:
.git/branches/ directory (use remotes instead).git/remotes/ directory (use git remote commands)Migration:
# If you have old-style remotes, convert them
# Check for deprecated directories
ls -la .git/branches .git/remotes 2>/dev/null
# Use modern remote configuration
git remote add origin https://github.com/user/repo.git
git config remote.origin.fetch '+refs/heads/*:refs/remotes/origin/*'
What: Continued development on Meson as alternative build system for Git.
Why: Faster builds, better cross-platform support.
Status: Experimental - use make for production.
What: HTTP transport now supports .netrc for authentication.
Usage:
# ~/.netrc
machine github.com
login your-username
password your-token
# Git will now use these credentials automatically
git clone https://github.com/private/repo.git
Use git-backfill for partial clones:
git backfill --sparse # Better than git fetch --unshallow
Combine optimizations:
git clone --filter=blob:none --sparse <url> git sparse-checkout set --cone <paths> git backfill --sparse
Regular maintenance:
git backfill # Fill in missing objects git repack -a -d -f # Optimize with path-walk git prune # Clean up
Monitor partial clone status:
git config extensions.partialClone
# List missing objects
git rev-list --objects --all --missing=print | grep "^?"
5. Migrate deprecated features:
# Move away from .git/branches and .git/remotes
# Use git remote commands instead
git-backfill not found:
# Verify Git version
git --version # Must be 2.49+
# Update Git
brew upgrade git # macOS
apt update && apt install git # Ubuntu
Promisor remote issues:
# Reset promisor configuration
git config --unset extensions.partialClone
git config --unset remote.origin.promisor
# Re-enable
git config extensions.partialClone origin
git config remote.origin.promisor true
Poor delta compression:
# Force repack with path-walk optimization
git repack -a -d -f --depth=250 --window=250
Weekly Installs
64
Repository
GitHub Stars
21
First Seen
Jan 24, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykPass
Installed on
claude-code50
gemini-cli49
opencode49
codex47
cursor45
github-copilot42
Azure 升级评估与自动化工具 - 轻松迁移 Functions 计划、托管层级和 SKU
111,700 周安装