git-helper
Git version control best practices, advanced operations, and modern features When user works with git, mentions git commands, branching, rebasing, merging, or git troubleshooting
What this skill does
# Git Helper Agent ## What's New in Git (2024-2026) ### Git 2.52 (2025) - **`git last-modified`**: New command to determine which commit most recently modified each file in a directory (5.5x faster than ls-tree + log) - **`git refs list` / `git refs exists`**: Consolidated reference operations - **`git repo`**: Experimental command for retrieving repository information - **`git maintenance` geometric task**: Alternative to all-into-one repacks - **`git sparse-checkout clean`**: Recover from difficult checkout state transitions - **Default branch change**: Git 3.0 will default to "main" instead of "master" - **Rust integration**: Optional Rust code for variable-width integer operations - **`git describe` 30% faster**, `git log -L` faster for merge commits ### Git 2.51 (2025) - **Stash interchange format**: `git stash export` and `git stash import` subcommands for cross-machine stash migration - **`--path-walk` repacking**: Significantly smaller pack files by emitting all objects from a given path simultaneously - **Cruft-free multi-pack indexes**: 38% smaller MIDXs, 35% faster writes, 5% better read performance at GitHub - **`git switch` / `git restore`**: No longer experimental after six years - **`git whatchanged`**: Marked for removal in Git 3.0 ### Git 2.50 (2025) - **ORT merge engine**: Completely replaced the older recursive merge engine - **`git merge-tree --quiet`**: Check mergeability without writing objects - **`git maintenance` new tasks**: `worktree-prune`, `rerere-gc`, `reflog-expire` - **Incremental multi-pack bitmap support**: Fast reachability bitmaps for extremely large repos - **`git cat-file` object filtering**: Filter objects by type using partial clone mechanisms - **Bundle URI**: Faster fill-in fetches by advertising all known references from bundles ### Git 2.49 (2025) - **Name-hash v2**: Dramatically improved packing (fluentui: 96s to 34s, 439 MiB to 160 MiB) - **`git backfill`**: Batch-fault missing blobs in `--filter=blob:none` partial clones - **zlib-ng support**: ~25% speed improvement for compression - **`git clone --revision`**: Clone specific commits without branch/tag references - **`git gc --expire-to`**: Manage pruned objects by moving them elsewhere - **First Rust code integration** via libgit-sys and libgit crates ### Git 2.48 (2025) - **Faster checksums**: 10-13% performance improvement in serving fetches/clones using non-collision-detecting SHA-1 for trailing checksums - **`range-diff --remerge-diff`**: Review merge conflict resolutions during rebase - **Remote HEAD tracking**: Fetch auto-updates `refs/remotes/origin/HEAD` if missing; configure `remote.origin.followRemoteHead` - **Meson build system**: Alternative build system alongside Make/CMake/Autoconf - **Memory leak elimination**: Entire test suite passes with leak checking - **`BreakingChanges.txt`**: Documents anticipated deprecations for future versions ### Git 2.47 (2024) - **Incremental multi-pack indexes**: Layered MIDX chains for faster object addition - **Separate hash function for checksums**: 10-13% serving performance improvement ### Git 2.46 (2024) - **Pseudo-merge bitmaps**: Faster reachability queries - **`git config list` / `git config get`**: New sub-command interface - **Reftable migration**: `git refs migrate --ref-format=reftable` for faster reference operations - **Enhanced credential helpers**: authtype/credential fields, multi-round auth (NTLM, Kerberos) ### Git 2.45 (2024) - **Reftable backend**: New reference storage with faster lookups, reads, and writes ### Git 2.44 (2024) - **Multi-pack reuse optimization**: Faster fetches and clones - **`builtin_objectmode` pathspec**: Filter paths by mode ## Overview Git is the distributed version control system used by virtually all modern software projects. This skill covers general Git best practices, advanced operations, branching strategies, and modern features. For worktree-specific workflows (parallel development, AI agent isolation), see the `worktree-workflow` skill instead. ## CLI Commands ### Auto-Approved (Safe, Read-Only) These commands are safe to run without user confirmation: - `git status` - Working tree status - `git log` - Commit history (with `--oneline`, `--graph`, `--all`, `--since`, `--author`) - `git diff` - Show changes (staged: `--cached`, between branches, specific files) - `git branch` - List branches (`-a` for all, `-v` for verbose, `--merged`, `--no-merged`) - `git tag` - List tags (`-l "v1.*"` for patterns) - `git show` - Show commit details - `git remote -v` - List remotes - `git stash list` - List stashed changes - `git reflog` - Reference log history - `git blame` - Line-by-line authorship - `git shortlog` - Summarized log output - `git config --list` - Show configuration - `git rev-parse` - Parse revision/path info - `git ls-files` - Show tracked files - `git describe` - Human-readable name from commit ### Common Operations ```bash # Stage changes git add <file> # Stage specific file git add -p # Interactive staging (hunk-by-hunk) git add -N <file> # Track file without staging content # Commit git commit -m "message" # Commit with message git commit --amend # Amend last commit (message or content) git commit --fixup=<sha> # Create fixup commit for later autosquash git commit --allow-empty # Empty commit (useful for CI triggers) # Branch operations git branch <name> # Create branch git branch -d <name> # Delete merged branch git branch -D <name> # Force delete branch git branch -m <old> <new> # Rename branch git switch <branch> # Switch branch (preferred over checkout) git switch -c <new-branch> # Create and switch # Remote operations git fetch # Fetch from default remote git fetch --all --prune # Fetch all remotes and prune stale tracking git pull --rebase # Pull with rebase instead of merge git push -u origin <branch> # Push and set upstream # Undoing changes git restore <file> # Discard working tree changes (preferred over checkout --) git restore --staged <file> # Unstage file git reset --soft HEAD~1 # Undo last commit, keep changes staged git reset --mixed HEAD~1 # Undo last commit, keep changes unstaged git revert <sha> # Create a new commit that undoes a previous commit ``` ### Log and History ```bash # Useful log formats git log --oneline --graph --all --decorate git log --since="2 weeks ago" --author="name" git log --follow -p -- <file> # Full history of a file including renames git log -S "search_string" # Find commits that add/remove a string (pickaxe) git log -G "regex_pattern" # Find commits matching regex in diffs git log --first-parent # Follow only first parent (clean merge history) git log --diff-filter=D -- <path> # Find when files were deleted # Comparing git diff main..feature # Changes in feature not in main git diff main...feature # Changes since feature branched from main git diff --stat # Summary of changes git diff --name-only # Just filenames git diff --word-diff # Word-level diff ``` ## Essential Workflows ### Creating Good Commits 1. **Atomic commits**: Each commit should represent one logical change 2. **Write clear messages**: Follow conventional commit format ``` type(scope): short description Longer explanation if needed. Wrap at 72 characters. Refs: #123 ``` Types: `feat`, `fix`, `docs`, `style`, `refactor`, `test`, `chore`, `perf`, `ci`, `build`, `revert` 3. **Stage intentionally**: Use `git add -p` to review each hunk 4. **Verify before committing**: Run `git diff --cached` to review staged changes ### Syncing with Upstream ```bash # Rebase approach (linear history) git fetch origin git rebase origin/main # If conflicts arise during rebase git status # See conflicted files # ... resolv
Related in General
modeling-omnistudio-epc-catalog
IncludedSalesforce Industries CME EPC product-modeling skill for Product2-based catalog creation. Use when creating EPC products, configuring product attributes, building offer bundles with Product Child Items, or reviewing EPC DataPack JSON metadata for product catalog changes. TRIGGER when: user creates or updates Product2 EPC records, AttributeAssignment payloads, AttributeMetadata/AttributeDefaultValues, Offer bundles, or ProductChildItem relationships. DO NOT TRIGGER when: designing OmniScripts/FlexCards/Integration Procedures (use building-omnistudio-omniscript, building-omnistudio-flexcard, or building-omnistudio-integration-procedure), implementing Apex business logic (use generating-apex), or troubleshooting deployment pipelines (use deploying-metadata).
relationship-science-coach
IncludedUse this skill for direct, practical adult relationship coaching: couples conflict, repair, trust, marriage, dating, flirting, attachment patterns, emotional connection, sex, desire differences, eroticism, kink negotiation, affection, love languages, breakups, and long-term passion. Draw on Gottman, EFT and Hold Me Tight, attachment science, modern sex research, Perel, Nagoski, Kerner, Schnarch, Love and Stosny, and flexible love-language tools. Be concrete and low-hedge. Redirect only for imminent danger, abuse, coercive control, minors, non-consent, self-harm, stalking, or medical/legal/psychiatric decisions.
building-sf-integrations
IncludedSalesforce integration architecture and runtime plumbing with 120-point scoring. Use this skill to set up Named Credentials, External Credentials, External Services, REST/SOAP callout patterns, Platform Events, and Change Data Capture. TRIGGER when: user sets up Named Credentials, External Services, REST/SOAP callouts, Platform Events, CDC, or touches .namedCredential-meta.xml files. DO NOT TRIGGER when: Connected App/OAuth config (use configuring-connected-apps), Apex-only logic (use generating-apex), or data import/export (use handling-sf-data).
venue-templates
IncludedAccess comprehensive LaTeX templates, formatting requirements, and submission guidelines for major scientific publication venues (Nature, Science, PLOS, IEEE, ACM), academic conferences (NeurIPS, ICML, CVPR, CHI), research posters, and grant proposals (NSF, NIH, DOE, DARPA). This skill should be used when preparing manuscripts for journal submission, conference papers, research posters, or grant proposals and need venue-specific formatting requirements and templates.
let-fate-decide
IncludedDraws the 12 Houses of the Zodiac Tarot spread to inject entropy into planning when prompts are vague, ambiguous, or casually delegated. Interprets the spread to guide next steps. Use when the user says 'let fate decide', 'YOLO', 'whatever', 'idk', or other nonchalant phrases, makes Yu-Gi-Oh references, or when you are about to arbitrarily pick between multiple reasonable approaches. Prefer over ask-questions-if-underspecified when the user's tone is casual or playful rather than precision-seeking.
net-ops
IncludedCross-platform network troubleshooting (Windows, macOS, Linux) via local or remote shell. Use for: DNS broken, can't resolve hostnames, nslookup/dig works but apps fail, NRPT, WFP, scutil, /etc/resolver, systemd-resolved, /etc/resolv.conf, NetworkManager, VPN DNS leak residue (ProtonVPN/Mullvad/WireGuard/AnyConnect), AV/firewall blocking DNS or DoH, Tailscale DNS interaction, intermittent connectivity, remote diagnostics over SSH.