Search code examples
gitgit-stash

How to stash changes in current folder?


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.


Solution

  • git stash push -- path/to/folder
    

    Does the trick for me.