Loading...
Loading...
Advanced Git operations wrapper. Optimizes token usage by guiding complex git workflows into efficient CLI commands.
npx skill4agent add oimiragieo/agent-studio git-expertgitwinget install --id Git.Git -e --source wingetbrew install gitxcode-select --installapt-get install gitdnf install gitpacman -S gitgit --versiongit status -sgit add -pgit diff --cachedgit switch -c <branch>git checkout -b <branch>git branchgit log --oneline -5git log --follow <file>git restore <file>git reset --soft HEAD~1git fetchgit mergegit pullgit config --global color.ui autouser.nameuser.email.gitignoregit merge --squashgit cherry-pick <commit>commit-validatortddverification-before-completion.claude/workflowsgit statusgit status -sgit diff --cachedgit log --oneline -5git add <file>
git diff --cached # REVIEW THIS!
git commit -m "feat: description"git reset --soft HEAD~1git status<<<<====>>>>git add <file>git commit --no-editgit push --force--force-with-lease| Anti-Pattern | Why It Fails | Correct Approach |
|---|---|---|
| Overwrites teammates' commits; destroys in-progress rebase branches | Use |
Committing | Permanently visible in history even after deletion; requires key rotation | Add sensitive files to |
| Long-lived feature branches (>5 days) | Massive merge conflicts; integration bugs discovered too late | Use short-lived branches with daily rebases onto main (trunk-based dev) |
| Makes | Use conventional commits: |
| Merging without pulling latest base | Stale merge base; CI catches conflicts only after the merge lands | |
filesgit init --ref-format=reftable my-repogit rev-parse --show-ref-format
# outputs: files OR reftablefilesreftablegit clone --ref-format=reftablefiles# Generate or update multi-pack index
git multi-pack-index write --stdin-packs
# Verify the MIDX
git multi-pack-index verify
# Enable via maintenance
git maintenance startgit clonegit fetch# Clone without checking out any files
git clone --no-checkout --filter=blob:none https://github.com/org/monorepo.git
cd monorepo
# Initialize in cone mode (recommended — uses fast prefix matching)
git sparse-checkout init --cone
# Check out only specific directories
git sparse-checkout set frontend docs shared/utils
# See what is currently checked out
git sparse-checkout list
# Add more directories without losing current ones
git sparse-checkout add backend/api
# Disable sparse checkout (restore full working tree)
git sparse-checkout disablegit clone --filter=blob:none --sparse https://github.com/org/monorepo.git
cd monorepo
git sparse-checkout set services/payments| Mode | Pattern Matching | Performance |
|---|---|---|
| Cone (recommended) | Directory prefix only | Fast (O(log n) path matching) |
| Non-cone | Full gitignore-style patterns | Slow on large trees |
# Clone a large repo with all performance features enabled
scalar clone https://github.com/org/large-monorepo.git
# Register an existing repo with Scalar
scalar register
# Run all maintenance tasks manually
scalar run all
# View configured enlistments
scalar list--filter=blob:nonecore.fsmonitor# Configure SSH signing globally
git config --global gpg.format ssh
git config --global user.signingKey ~/.ssh/id_ed25519.pub
# Sign all commits automatically
git config --global commit.gpgSign true
# Or sign a single commit manually
git commit -S -m "feat: add payment service"
# Verify a commit
git verify-commit HEAD# ~/.config/git/allowed_signers
alice@example.com ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAA...
bob@example.com ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAA...git config --global gpg.ssh.allowedSignersFile ~/.config/git/allowed_signers
git log --show-signatureSettings > SSH and GPG keys > New SSH key > Signing Key# Generate a resident key on a FIDO2 security key (e.g., YubiKey)
ssh-keygen -t ed25519-sk -O resident -f ~/.ssh/id_ed25519_sk_fido2
git config --global user.signingKey ~/.ssh/id_ed25519_sk_fido2.pubortortrecursive# ort is the default; explicitly select if needed
git merge -s ort feature/my-feature
# Rename detection threshold (default 50%)
git merge -X rename-threshold=80 feature/rename-heavy-branch
# Conflict style: diff3 (shows common ancestor) — strongly recommended
git config --global merge.conflictStyle diff3
# Or zdiff3 (even cleaner context in conflicts, Git 2.35+)
git config --global merge.conflictStyle zdiff3# Enable file system monitor (avoids scanning entire tree for status)
git config core.fsmonitor true
git config core.untrackedCache true
# Precompute commit graph for faster log/blame
git commit-graph write --reachable --changed-paths
git config fetch.writeCommitGraph true
# Partial clone — skip large blobs on clone, fetch on demand
git clone --filter=blob:none <url>
# Shallow clone (CI use case — last N commits only)
git clone --depth=1 <url>
# Check repository health and performance
GIT_TRACE_PERFORMANCE=1 git statusgitflow.claude/context/memory/learnings.md.claude/context/memory/learnings.md.claude/context/memory/issues.md.claude/context/memory/decisions.mdASSUME INTERRUPTION: If it's not in memory, it didn't happen.