Stash A Single Untracked File
If you want to stash everything in your work tree and untracked files, you can run:
If you want a bit more control over what gets stashed from the work tree, you can interactively stash with --patch
(or -p
):
Unfortunately, the two don't work together.
So, if you'd like to stash a specific untracked file, you can instead formulate a command like the following:
This will stash just the specified untracked file and leave the rest of them as they are.
I found this useful when trying to test the setup of a new library. There was an extra new file that I didn't think I needed. Stashing it temporarily gets it out of the way without losing it.
Last updated