git_stash
Manage git stashes to set aside uncommitted work before switching branches and restore it later. Supports list, push, pop, and drop operations.
Instructions
Manage stashes: list, push changes, or pop and drop existing stashes. Use this to set aside uncommitted work before switching branches, or to restore previously stashed work. Does NOT discard changes permanently — push preserves them for later; only drop, which requires confirmed=True, removes a stash, and push needs modified tracked files. Best for: setting aside work-in-progress to switch context. Returns: stash listing, or git stash output. Use git_checkout after stashing to switch branches; use git_reset to discard changes instead of preserving them.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| message | No | Stash message | |
| confirmed | No | Explicit confirmation for stash drop | |
| operation | No | One of: list, push, pop, drop | list |
| repo_path | No | Path to the git repository, defaults to '.' (the server working directory) | . |
| stash_ref | No | Stash reference like 'stash@{0}' |