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
git


source to share


No one has answered this question yet

See similar questions:

3
Cancel "git stash --patch"

or similar:

2838
Hide only one file from multiple files that have changed since Git?
2416
Message 'src refspec master does not match any' when pushing commits to Git
1278
How can I selectively merge or fetch changes from another branch in Git?
1121
How to remove one file from staging area (undo git add)?
710
Create a git patch from changes in the current working directory
706
Git: create a branch from unchecked / uncommitted changes to master
697
How to checkout a single file (or changes to a file) from a git tag?
658
How can I allow git to say "Commit your changes or hide them before you can merge"?
589
How do you reset (reset) a Git repository for a specific commit?
468
Various Ways to Remove Local Git Changes



All Articles
Loading...
X
Show
Funny
Dev
Pics