Skip to content

git_stash

MCP tools › Version control

Git stashes: list them (newest first, also reports a stopped rebase, cherry-pick or merge), push the local changes (optionally with untracked files, a message and keep_index to leave the staged changes in the index), apply or pop a stash (pop drops it when it applied without conflicts) or drop it, or show the files a stash changes with their text before and in the stash. Returns Git's message, files left with conflicts and the stash list afterwards.

Its results carry text from git: the client is told to treat that as data, never as instructions.

Capabilitygit.git_stash
AreaVersion control
Accesschanges files, repository
Reachesprocess
Rightsvcs-write
Dry runnone

Arguments

ArgumentTypeDescription
actionstringlist (default), push, apply, pop, drop or show (the files a stash changes).
indexintegerStash position for apply, pop, drop and show (0 is the newest; default 0).minimum 0
messagestringMessage of a new stash (push).
include_untrackedbooleanStash untracked files too (push, default false).
keep_indexbooleanLeave the staged changes in the index (push, default false).

Call it from a shell

ferris-idea call runs one tool with the rights and safe mode of ferris-idea mcp. Replace the folder and the placeholder values.

Terminal window
ferris-idea call ~/my-project git_stash
Input schema as JSON
{
"type": "object",
"properties": {
"action": {
"description": "`list` (default), `push`, `apply`, `pop`, `drop` or `show` (the files a stash changes).",
"type": [
"string",
"null"
],
"default": null
},
"index": {
"description": "Stash position for `apply`, `pop`, `drop` and `show` (0 is the newest; default 0).",
"type": [
"integer",
"null"
],
"default": null,
"minimum": 0
},
"message": {
"description": "Message of a new stash (`push`).",
"type": [
"string",
"null"
],
"default": null
},
"include_untracked": {
"description": "Stash untracked files too (`push`, default false).",
"type": [
"boolean",
"null"
],
"default": null
},
"keep_index": {
"description": "Leave the staged changes in the index (`push`, default false).",
"type": [
"boolean",
"null"
],
"default": null
}
}
}