The "Stash selected files..." fails with did not match any file(s) known to git error messages if the selected file(s) are not also staged. Adding the -u parameter will allow git to stash unstaged selected files, too.
It also looks like the stash message is not quoted, which causes issues if the stash message is more than a single word. The parameter should be quoted (with any quotes within the message escaped with a backslash) to prevent this error.
Example of quoted string with internal quotes escaped:
"This is \"the\" way to do it"
Change the current command being executed from:
git stash push -m MESSAGEHERE -- PATHSHERE
to:
git stash push -m "QUOTEESCAPEDMESSAGEHERE" -u -- PATHSHERE
The "Stash selected files..." fails with
did not match any file(s) known to git
error messages if the selected file(s) are not also staged. Adding the-u
parameter will allow git to stash unstaged selected files, too.It also looks like the stash message is not quoted, which causes issues if the stash message is more than a single word. The parameter should be quoted (with any quotes within the message escaped with a backslash) to prevent this error. Example of quoted string with internal quotes escaped:
"This is \"the\" way to do it"
Change the current command being executed from:
git stash push -m MESSAGEHERE -- PATHSHERE
to:git stash push -m "QUOTEESCAPEDMESSAGEHERE" -u -- PATHSHERE