skills/git-workflows/skills/stash/SKILL.md
Stash management - save, pop, list, and drop stashed changes
npx skillsauth add dtsong/my-claude-setup Git StashInstall 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.
clear subcommand is destructive — permanently deletes all stashesstash@{N} format where N is a non-negative integer. Reject arbitrary strings, shell metacharacters, or null bytes.save, pop, apply, list, show, drop, clear accepted.Save, restore, list, and manage stashed changes.
/git-stash # Stash all changes (default)
/git-stash save "message" # Stash with descriptive message
/git-stash pop # Apply and remove most recent stash
/git-stash apply # Apply stash but keep it
/git-stash list # List all stashes
/git-stash show # Show changes in most recent stash
/git-stash show stash@{2} # Show changes in specific stash
/git-stash drop # Delete most recent stash
/git-stash drop stash@{2} # Delete specific stash
/git-stash clear # Delete all stashes (use with caution)
# Check if there are changes to stash
if git diff --quiet && git diff --cached --quiet; then
echo "No changes to stash."
exit 0
fi
# Show what will be stashed
git status --short
# Stash with automatic message
git stash push -m "WIP on $(git branch --show-current): $(date '+%Y-%m-%d %H:%M')"
# Or with custom message
git stash push -m "Custom message here"
# Include untracked files
git stash push -u -m "Including untracked files"
# Include everything (even ignored files)
git stash push -a -m "Including all files"
# Apply most recent and remove from stash list
git stash pop
# Apply specific stash
git stash pop stash@{2}
# Apply but keep in stash list (useful for applying to multiple branches)
git stash apply
# Apply specific stash
git stash apply stash@{1}
# List all stashes with details
git stash list --format="%gd: %s (%cr)"
# Show diff of most recent stash
git stash show -p
# Show specific stash
git stash show -p stash@{2}
# Show just file names
git stash show --name-only
# Remove most recent stash
git stash drop
# Remove specific stash
git stash drop stash@{2}
# Clear all stashes
git stash clear
Stashed changes on feat/dark-mode
Changes stashed:
M src/components/Theme.tsx
M src/hooks/useTheme.ts
A src/styles/dark.css
Stash saved as: stash@{0}
Message: "WIP on feat/dark-mode: 2025-01-25 10:30"
To restore: /git-stash pop
Your stashes:
stash@{0}: WIP on feat/dark-mode: toggle component (2 hours ago)
stash@{1}: WIP on main: experimental changes (1 day ago)
stash@{2}: WIP on feat/auth: login form backup (3 days ago)
Total: 3 stashes
Commands:
/git-stash pop # Apply stash@{0}
/git-stash show stash@{1} # View stash contents
/git-stash drop stash@{2} # Delete specific stash
Applied stash@{0} to feat/dark-mode
Restored changes:
M src/components/Theme.tsx
M src/hooks/useTheme.ts
A src/styles/dark.css
Stash removed from list.
Conflict while applying stash!
Conflicting files:
- src/components/Theme.tsx
The stash was NOT dropped.
Options:
/git-conflicts # Resolve conflicts
git stash drop # Drop stash after resolving
git checkout --theirs . # Keep current, discard stash
git checkout --ours . # Keep stash, discard current
git stash push -m "descriptive message" makes stashes easier to manage-u flag to include new filesapply if you might need the stash again# Quick save before switching branches
/git-stash save "before switching to main"
/git-switch main
# Pull updates then restore
/git-stash
/git-pull
/git-stash pop
# Move changes to a new branch
/git-stash
/git-branch feat/new-feature
/git-switch feat/new-feature
/git-stash pop
/git-pull if you have uncommitted changes/git-switch to safely change branches/git-stash pop after operations completedevelopment
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'.
development
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.
development
Review UI code for Web Interface Guidelines compliance. Use when asked to "review my UI", "check accessibility", "audit design", "review UX", or "check my site against best practices".
development
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.