What is the difference between the following commands in Visual Studio 2019 for GIT stash?
pop and restore staged (--index)
pop All as unstaged
while using https://visualstudio.github.com/
Pop: Applies the changes to the code branch and deletes the Stash. Pop and Restore Staged: Pops changes to code branch and ensures staging of previously staged files again. Pop All as Unstaged: Pops changes to code branch and won't stage files that were staged before.
Restoring stashed changesIf you are not already on the branch where the changes are stashed, click Current Branch, then click the branch with stashed changes. In the left sidebar, click Stashed Changes. Click Restore.
git stash apply vs pop : They are almost similar except the fact that git stash pop throws away the (topmost, by default) stash when applying it, whereas git stash apply leaves it within the stash list for possible later use (or you'll then git stash drop it).
Generate a stash with custom options. Use stash only to generate a simple stash. Use Keep index to stash but keep all changes added to the index intact (besides stashing them). Use Include untracked if you want to stash also untracked files, leaving the working directory in a very clean state.
Found a good article : https://www.thomasclaudiushuber.com/2019/04/10/the-git-stash-functionality-in-visual-studio-2019 - and here is the answer:
If you hadn’t any staged files before you created the stash, then you won’t see a difference between the two options.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With