plugins/git-master/skills/git-2025-features/SKILL.md
Git 2.49+ features and modern Git workflows (2025-2026). PROACTIVELY activate for: (1) Git 2.49+ features (reftables, sparse-checkout, partial clone, worktrees), (2) git-backfill for partial clones, (3) reftables migration (file backend to reftable backend), (4) sparse-checkout for monorepos, (5) git worktrees for parallel development, (6) partial clone (--filter=blob:none), (7) commit graph and bitmap optimizations, (8) trunk-based development workflows, (9) Git LFS, (10) modern alternatives to legacy commands. Provides: feature reference, version-detection snippets, sparse-checkout configuration, worktree workflow patterns, and migration guidance from older Git versions.
npx skillsauth add JosiahSiegel/claude-plugin-marketplace git-2025-featuresInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
📌 NOTE: For detailed Git 2.49+ features (git-backfill, path-walk API, zlib-ng), see git-2-49-features.md skill.
MANDATORY: Always Use Backslashes on Windows for File Paths
When using Edit or Write tools on Windows, you MUST use backslashes (\) in file paths, NOT forward slashes (/).
Examples:
D:/repos/project/file.tsxD:\repos\project\file.tsxThis applies to:
NEVER create new documentation files unless explicitly requested by the user.
Major additions: git-backfill, path-walk API, zlib-ng performance, improved delta compression.
See git-2-49-features.md for complete coverage.
What: New reference storage format replacing loose ref files and packed-refs.
Benefits:
Migration:
# Check current ref storage format
git config core.refStorage
# Migrate to reftables
git refs migrate --ref-storage=reftables
# Verify migration
git fsck --full
git log --oneline -5
# Roll back if needed (before critical operations)
git refs migrate --ref-storage=files
When to use:
Git 2.48:
Git 2.49:
Benefits automatically in:
What: Check out only a subset of files from repository.
Use cases:
Cone Mode (Default - Recommended):
# Clone with sparse-checkout
git clone --filter=blob:none --sparse <repo-url>
cd <repo>
# Initialize sparse-checkout in cone mode
git sparse-checkout init --cone
# Add directories to checkout
git sparse-checkout set src/api src/shared docs
# Add more directories
git sparse-checkout add tests/integration
# View current patterns
git sparse-checkout list
# Check what would be matched
git sparse-checkout check-rules src/api/users.ts
# Disable sparse-checkout
git sparse-checkout disable
Advanced Patterns (Non-Cone Mode):
# Enable pattern mode
git sparse-checkout init --no-cone
# Add patterns (one per line)
git sparse-checkout set \
"*.md" \
"src/api/*" \
"!src/api/legacy/*"
# Read patterns from file
git sparse-checkout set --stdin < patterns.txt
Reapply Rules:
# After merge/rebase that materialized unwanted files
git sparse-checkout reapply
What: Clone repository without downloading all objects initially.
Filters:
Usage:
# Clone without blobs (fetch on demand)
git clone --filter=blob:none <repo-url>
# Clone without large files
git clone --filter=blob:limit=10m <repo-url>
# Combine with sparse-checkout
git clone --filter=blob:none --sparse <repo-url>
cd <repo>
git sparse-checkout set src/api
# Convert existing repository to partial clone
git config extensions.partialClone origin
git config remote.origin.promisor true
git fetch --filter=blob:none
# Prefetch all missing objects
git fetch --unshallow
Combine Partial Clone + Sparse-Checkout:
# Ultimate efficiency: Only objects for specific directories
git clone --filter=blob:none --sparse <repo-url>
cd <repo>
git sparse-checkout set --cone src/api
git checkout main
# Result: Only have objects for src/api
Check promisor objects:
# Verify partial clone status
git config extensions.partialClone
# See promisor packfiles
ls -lah .git/objects/pack/*.promisor
# Force fetch specific object
git rev-list --objects --missing=print HEAD | grep "^?"
What: Multiple working directories from one repository.
Benefits:
Basic Operations:
# List worktrees
git worktree list
# Create worktree for existing branch
git worktree add ../project-feature feature-branch
# Create worktree with new branch
git worktree add -b new-feature ../project-new-feature
# Create worktree from remote branch
git worktree add ../project-fix origin/fix-bug
# Remove worktree
git worktree remove ../project-feature
# Clean up stale worktree references
git worktree prune
Advanced Patterns:
# Worktree for PR review while coding
git worktree add ../myproject-pr-123 origin/pull/123/head
cd ../myproject-pr-123
# Review PR in separate directory
cd -
# Continue coding in main worktree
# Worktree for hotfix
git worktree add --detach ../myproject-hotfix v1.2.3
cd ../myproject-hotfix
# Make hotfix
git switch -c hotfix/security-patch
git commit -am "fix: patch vulnerability"
git push -u origin hotfix/security-patch
# Worktree organization
mkdir -p ~/worktrees/myproject
git worktree add ~/worktrees/myproject/feature-a -b feature-a
git worktree add ~/worktrees/myproject/feature-b -b feature-b
git worktree add ~/worktrees/myproject/pr-review origin/pull/42/head
Best Practices:
~/projects/
myproject/ # Main worktree
myproject-feature/ # Feature worktree
myproject-review/ # Review worktree
# Remove merged worktrees
git worktree list | grep feature | while read wt branch commit; do
if git branch --merged | grep -q "$branch"; then
git worktree remove "$wt"
fi
done
What: Tool for optimizing very large repositories (Microsoft-developed).
# Install scalar (comes with Git 2.47+)
scalar register <path>
# Clone with scalar optimizations
scalar clone --branch main <repo-url>
# Enables automatically:
# - Sparse-checkout (cone mode)
# - Partial clone (blob:none)
# - Multi-pack-index
# - Commit-graph
# - Background maintenance
# Unregister
scalar unregister <path>
# Delete repository
scalar delete <path>
What: Background process to fetch missing objects in partial clone.
# Fetch missing blobs in background
git backfill
# Configure batch size
git backfill --min-batch-size=1000
# Respect sparse-checkout patterns
git backfill --sparse
Traditional Clone:
git clone large-repo
# Size: 5GB, Time: 10 minutes
Sparse-Checkout:
git clone --sparse large-repo
git sparse-checkout set src/api
# Size: 500MB, Time: 3 minutes
Partial Clone:
git clone --filter=blob:none large-repo
# Size: 100MB, Time: 1 minute
Partial Clone + Sparse-Checkout:
git clone --filter=blob:none --sparse large-repo
git sparse-checkout set src/api
# Size: 50MB, Time: 30 seconds
Sparse-Checkout:
Partial Clone:
Worktrees:
Combine All:
Sparse-checkout not working:
# Verify configuration
git config core.sparseCheckout
git config core.sparseCheckoutCone
# Re-apply patterns
git sparse-checkout reapply
# Check patterns
git sparse-checkout list
Missing objects in partial clone:
# Fetch specific object
git fetch origin <commit>
# Fetch all missing
git fetch --unshallow
# Verify promisor config
git config extensions.partialClone
Worktree issues:
# Locked worktree
git worktree unlock <path>
# Corrupted worktree
git worktree remove --force <path>
git worktree prune
# Branch already checked out
git checkout --ignore-other-worktrees <branch>
From traditional to optimized workflow:
# 1. Current large clone
cd large-project
du -sh .git # 5GB
# 2. Create optimized new clone
cd ..
git clone --filter=blob:none --sparse large-project-new
cd large-project-new
git sparse-checkout set src/api src/shared
# 3. Verify size
du -sh .git # 50MB
# 4. Switch workflow
cd ../large-project-new
# 5. Delete old clone when comfortable
rm -rf ../large-project
development
Use for Clerk sessions, tokens, webhooks, orgs, and security. PROACTIVELY activate for session tokens, JWT templates, getToken(), custom claims, pending sessions, multi-session UX, organizations, roles, permissions, system vs custom permissions, features/plans, MFA/passkeys/password policy/bot protection, Clerk webhooks, Svix signatures, verifyWebhook(), user/org sync, retries/replays, environment variables, custom domains, secret rotation, logs, and auth security reviews. Provides token semantics, webhook idempotency, authorization defaults, and hardening checklist.
tools
Use for Clerk in Next.js. PROACTIVELY activate for @clerk/nextjs setup, App Router auth()/currentUser(), clerkMiddleware(), proxy.ts/middleware.ts, createRouteMatcher(), protected pages/layouts/Route Handlers/Server Actions/API routes/tRPC, auth.protect() role/permission/token checks, ClerkProvider placement, server-only clerkClient, Link prefetch, redirects, 401/404 auth failures, custom domains, __clerk proxy paths, and deployment gotchas. Provides file patterns, server/client boundary rules, matcher templates, and production checks.
development
Use for Clerk frontend auth flows. PROACTIVELY activate for React, JavaScript, Vue, Nuxt, Astro, Expo, React Router, TanStack React Start, or SPA setup; ClerkProvider and publishable-key wiring; SignIn/SignUp/UserButton/UserProfile/OrganizationSwitcher; custom useUser/useAuth/useClerk/useSignIn/useSignUp/useSession/useOrganization flows; multi-session UX; cross-origin getToken() fetches; loading states, redirects, routing, CORS/cookies, or hydration bugs. Provides SDK selection, UI patterns, token-fetch templates, and frontend gotchas.
development
Use for Clerk dev/prod readiness, deployment, and multi-language implementation planning. PROACTIVELY activate for environment variables, pk_test/sk_test vs pk_live/sk_live, local dev, preview/staging/prod instances, domains/DNS, redirects, OAuth credentials, custom domains/proxy, authorizedParties, CSP, CORS/cookies, webhooks/tunnels, Vercel/Netlify/Cloudflare/API gateways, monitoring/troubleshooting, and backends in Node/Express/Fastify, Python/FastAPI/Django/Flask, Go, Ruby/Rails, Java/Spring, .NET, PHP/Laravel. Provides checklists, rollout plans, and language-portable patterns.