Git stash with --patch for selective stashing
TIL you can use git stash --patch (or -p) to interactively select which hunks to stash:
git stash -p
Git will show you each change and ask if you want to stash it. Super useful when you have mixed changes and only want to stash some of them.
Options at each hunk:
y- stash this hunkn- don’t stash this hunks- split into smaller hunksq- quit (stash what you’ve selected so far)