Many times I need to take a snapshot of the current working directory as a backup before making experimental changes. Here is what I do.
git stash
git stash apply
But I used some applications that listen for disk changes and they cause unwanted behavior. I want to do the same without cleaning the local working directory in the first step.
It can be a line of code or a multi-line string as I will just create a function for it.
Bonus: Nice if it preserves the current staging/non-staging area too.