DEV Community

Discussion on: How to stash a specific file or multiple files?

Collapse
 
ryzngard profile image
Andrew Hall

git stash pop is like apply + drop as well. I think git stash --keep-index keeps everything staged, and stashes unstaged changes. Useful if it's hard to type the pathspec for multiple files, or if you want to stash some changes to a file but not all.

Collapse
 
andy profile image
Andy Zhao (he/him)

Big fan of git stash pop. Definitely a 1 command > 2 commands scenario.

Thread Thread
 
deciduously profile image
Ben Lovy

Whoa, TIL. Git's pretty cool, isn't it