Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Git Stash Failed

I am using SmartGit in Windows. Today I needed to do a hard reset back a couple commits. SmartGit automatically made a stash for me of my modified files.

After the reset, it tried to apply the stash:

$ git.exe stash apply --index stash@{0}

But it gave me:

Apply Stash: stash failed (return code 1)

I can view the stash contents and see all my code, but I can't apply the stash. How do I fix this?

like image 226
Jake Wilson Avatar asked Oct 15 '25 16:10

Jake Wilson


2 Answers

Just do git stash pop. It will get you your stashed changes in the working tree. (pop considering you want stash@{0}.

like image 127
Mudassir Razvi Avatar answered Oct 17 '25 07:10

Mudassir Razvi


Can you export it to a patch, and then try to apply manually?

git stash show -p > my_stash.patch
like image 24
acanby Avatar answered Oct 17 '25 05:10

acanby



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!