Git Workflows
Git Workflows
A comprehensive suite of git workflow skills for local repository operations.
Input Sanitization
- Branch names: alphanumeric, hyphens, underscores, forward slashes, and dots only — reject
.., shell metacharacters, or null bytes - Remote names: alphanumeric and hyphens only
- File paths for stash/diff: reject
..traversal, null bytes, and shell metacharacters
Available Skills
Sync & Remote Operations
| Skill | Purpose | Invoke |
|---|---|---|
/git-sync |
Fetch and show remote changes | git sync, what's new upstream |
/git-pull |
Pull with merge/rebase strategy | git pull, get latest |
/git-push |
Push with upstream handling | git push, push changes |
Stash Management
| Skill | Purpose | Invoke |
|---|---|---|
/git-stash |
Save/pop/list stashed changes | git stash, save my work |
Branch Operations
| Skill | Purpose | Invoke |
|---|---|---|
/git-branch |
Create branches with naming conventions | git branch, new branch |
/git-switch |
Switch branches safely | git switch, checkout branch |
/git-branches |
List and visualize branch status | git branches, list branches |
/git-delete-branch |
Delete local/remote with safety | delete branch, cleanup branch |
Integration & Merging
| Skill | Purpose | Invoke |
|---|---|---|
/git-merge-main |
Merge main into feature branch | merge main, update from main |
/git-rebase |
Rebase onto main with guidance | git rebase, rebase onto main |
/git-squash |
Squash commits non-interactively | git squash, clean up commits |
Conflict & Recovery
| Skill | Purpose | Invoke |
|---|---|---|
/git-abort |
Abort failed merge/rebase/cherry-pick | git abort, cancel merge |
/git-conflicts |
Guided conflict resolution | git conflicts, fix conflicts |
Quick Reference
# Sync workflow
/git-sync # See what's new
/git-pull # Get changes
/git-push # Push changes
# Branch workflow
/git-branch feat/xyz # Create branch
/git-switch main # Switch branch
/git-branches # See all branches
# Integration
/git-merge-main # Update from main
/git-rebase # Rebase on main
/git-squash # Clean up history
Gotchas
- Interactive rebase (
git rebase -i) requires a TTY and fails in Claude Code — usegit rebase(non-interactive) orgit rebase --onto git checkoutis ambiguous (branches vs files) — prefergit switchfor branches,git restorefor files- Force-push (
--force) to protected branches is rejected by most remotes — use--force-with-leasewhich fails if remote has new commits git stashdoesn't stash untracked files — usegit stash -uto include untrackedgit pullwith diverged branches creates merge commits — usegit pull --rebaseorgit pull --ff-onlyto avoid surprise mergesgit add .stages everything including.envfiles and secrets — always usegit add <specific-files>or checkgit statusfirst
Related Skills
/commit- Create commits with conventional messages/commit-push-pr- Full commit, push, and PR workflow/gh-pr-*- GitHub PR operations
More from dtsong/my-claude-setup
web-security-hardening
Security audit checklist for web applications. Use when reviewing, auditing, or hardening a web app's security posture. Covers rate limiting, auth headers, IP blocking, CORS, security middleware, input validation, file upload limits, ORM usage, and password hashing. Triggers on requests like "review security", "harden this app", "security audit", "check for vulnerabilities", or when building/reviewing API endpoints.
26vercel-react-best-practices
React and Next.js performance optimization guidelines from Vercel Engineering. This skill should be used when writing, reviewing, or refactoring React/Next.js code to ensure optimal performance patterns. Triggers on tasks involving React components, Next.js pages, data fetching, bundle optimization, or performance improvements.
3workflow
Use when planning implementation steps, deciding commit format, or structuring development approach. Provides brainstorm-plan-implement flow with conventional commits. Triggers on 'how should I approach this', 'commit format'.
2code-search
Fast codebase searches using grep/glob. Triggers on "find", "search", "where is", "grep for".
2generate-diagram
>
2git-status
Quick git queries - status, diff, log, blame. Triggers on "git status", "what changed", "show diff", "recent commits".
2