- Current branch: !`git branch --show-current`
Performs repository maintenance and cleanup with optional branch and stash management.
/plugin marketplace add laurigates/claude-plugins/plugin install git-plugin@laurigates-pluginsgit/git branch --show-currentgit status --porcelain=v2 --branch 2>/dev/nullgit branch -vv --format='%(refname:short) %(upstream:short) %(upstream:track)'git stash list 2>/dev/nulldu -sh .git 2>/dev/nullParse these parameters from the command (all optional):
--prune: Remove unreachable objects and optimize repository--gc: Run git garbage collection (aggressive)--verify: Verify integrity of git objects--branches: Clean up merged branches only--stash: Clean up stashes only--all: Run all maintenance tasks (default if no flags specified)Perform repository maintenance and cleanup based on the flags provided.
.gitignore and removing with git rm --cachedgit branch -d# Prune unreachable objects
git prune
# Run garbage collection
git gc --aggressive
# Repack objects
git repack -ad
# Show size improvement
du -sh .git
git fsck --full --strict
Report any issues found.
These operations are safe and non-destructive:
git gc - Garbage collectiongit prune - Prune unreachable objectsgit fsck - Verify integrityThese require user confirmation:
git branch -d - Delete branchesgit stash drop - Drop stashes