3 ms·
You can, I think, with `git stash push foo.js`
by fiddlerwoaroof 4y ago
You can, I think, with `git stash push foo.js`
- lmm 4y agoYou can't; depending on the options that will either stash your staged changes to foo.js, stash your unstaged changes to foo.js, or stash both but flatten them so that when you apply them they're all staged (or all unstaged). There's no way to stash it so that you can unstash it and get it back how it is now.
- fiddlerwoaroof 4y agoYeah, I’ve actually found WIP commits and a hook to block them from being pushed end up working better than stashes, so I haven’t spent a lot of time figuring out the complexities of stashes. My workflow here would be something like: git checkout -b save git commit # save staged changes git add . git commit -m WIP # save unstaged changes git checkout -