currently I got a few modified files into my local branch:
modified: commands/abc/Test.cs modified: common/des/Info.cs modified: common/pit/Abc.cs modified: services/Services123.cs I want to put to stash just first 3. How can I do that?
You can explicitly list files to stash after --
git stash -- commands/abc/Test.cs common/des/Info.cs common/pit/Abc.cs
Then your changes in services/Services123.cs won't be stashed.
(Note that in your specific case you could conveniently take advantage of the file names and use a wildcard, like git stash -- com*)
--keep-index, but warning : there's no --stash-index-only counterpart to do what you want. You'll have to 1) git stash --keep-index to save unstaged changes, then 2) do a regular git stash which will contain only your staged files, and finally recover in the working tree what you first stashed, with git stash pop stash{1}. At the end of this (slightly clunky) process, all your staged changes are stashed in stash{0}, and the other changes are in the working tree, waiting to be staged/discarded.2) git stash push -m "my_new_stash"....what else I can do ?