How to make git stash include new files that have not been staged? How to make git stash include new files that have not been staged? git git

How to make git stash include new files that have not been staged?


The problem seems to be that by default the stash command will not include untracked files.

To include untracked files, use the -u (--include-untracked) flag:

git stash -u

If the --include-untracked option is used, all untracked files are also stashed and then cleaned up with git clean, leaving the working directory in a very clean state.