Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"Git stash apply" all files, except one

Tags:

git

git-stash

I made a stash of multiple files (30 +) using git stash. I now want to apply the stash to all files except one. What is the best way to achieve this?

like image 245
Darren Findlay Avatar asked Oct 09 '16 13:10

Darren Findlay


1 Answers

Your best bet is to probably to git stash apply then git checkout -- [file] to remove the changes applied when applying the stash.

If you have changes in the file already, your best bet is to commit them before applying the stash, you could then rebase the commit and the stash into a single commit later if you wished.

like image 110
Daniel Squires Avatar answered Sep 29 '22 15:09

Daniel Squires