DEV Community

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

Collapse
 
gianpaj profile image
Gianfranco • Edited

This didn't work:
git stash _file_
This did:
git stash push _file_ --keep-index

$ git stash src/services/styles.ts
fatal: unknown subcommand: src/services/styles.ts

...
Enter fullscreen mode Exit fullscreen mode
git stash push src/services/styles.ts --keep-index
Saved working directory and index state WIP on _branch_name_: 32dbc82 ....
Enter fullscreen mode Exit fullscreen mode
$  git --version
git version 2.28.
Enter fullscreen mode Exit fullscreen mode