Support "stash save --patch" functionality #386

phil-s opened this Issue Mar 7, 2012 · 5 comments


None yet

4 participants


stash save --patch works the same way that git add --patch does, in letting you interactively determine which changes are added to the stash commit.

Ideally Magit would allow you to choose changes for stashing in the same ways that you can choose changes for staging.


Perhaps this could be implemented by a Magit command that stashes all staged changes, while leaving unstaged changes alone? I'm still not quite sure how one would accomplish this on the git side of things, but it sounds easier than implementing a completely separate staging area just for stashing.


This would be a really handy feature: +1. @DarwinAwardWinner's seems like a good suggestion for the implementation.

Magit member

There are two ways to emulate this, no code needed. In both cases the final step is s -k s (git stash --keep-index). Before that do one of the following.

  • Stage s the hunks you don't want to stash.

If staging changes you don't want to create an object from breaks your mental flow, do this instead.

  • Stage everything s, forget you just did that. Then "stage for the stash" individual hunks by actually unstaging u them.

But thinking about it some more, doing it they way you want is not actually that hard. I might have something by tomorrow. If I don't, poke me in a week or so.

@tarsius tarsius was assigned Jun 21, 2013
Magit member

There are two ways to emulate this

Not really.

[implementing this] is not actually that hard.

Yeah, right :-)

Please see
more specifically tarsius@fcd2f75
but I might amend to that.

@tarsius tarsius modified the milestone: 2.2.0, 2.1.0 Feb 8, 2014
@tarsius tarsius modified the milestone: 2.1.0, 2.2.0 Feb 22, 2014
Magit member

Implemented on the next branch (see #1220) in commit 6704b02.

@tarsius tarsius closed this Feb 26, 2014
@tarsius tarsius removed the 11 popup label May 29, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment