Git stash --patch does not discard hidden changes from worktree when any chunk is split

When git stash --patch

used to selectively change a shift, it works as described in the document, with none of them split into smaller changes using an interactive command to do so.

If any change breaks during an interactive stash, then while git creates the correct stamp of the assigned changes, it does not roll back any of the hidden changes from the working tree.

As a workaround, I was doing something like this:

$ git commit                 # temporary work-in-progress commit
$ git diff stash@{0} > diffs # obtain stashed changes as a diff
$ git reset                  # undo temp. commit
$ git apply < diffs          # remove stashed changes

      

Is there a way to get the desired behavior from git stash

in one step?

(I'm on 1.7.9.5)

+1


source to share





All Articles