Last Updated: February 25, 2016
·
1.177K
· juanghurtado

Stash only certain files

To stash only certain files, add the ones that you want to keep out of the stash and run git stash --keep-index:

Create 4 sample files

$ touch file1.txt file2.txt file3.txt file4.txt

Add the files that you want to keep out of the stash

$ git add file1.txt file2.txt

Stash remaining files

$ git stash --keep-index