How to stash changes in current folder?

stdcall picture stdcall · May 8, 2013 · Viewed 35k times · Source

I would like to stash only the changes in the current folder and its subfolders.

How can I achieve that?

I have tried the obvious approach - git stash . but it doesn't seem to work.

I know I can create temporary commits and delete them afterward, but I want to know if git stash supports stashing specific folders.

Answer

gorpacrate picture gorpacrate · Aug 9, 2018
git stash push -- path/to/folder

Does the trick for me.