I did some changes to some file in the working directory.
I then stashed the changes:
$ git stash
Saved working directory and index state WIP on B03799: 627b569 Merge pull request #376 from xxx/B02814
HEAD is now at 627b569 Merge pull request #376 from xxx/B02814
Then I ran a couple of commands, the related commands of which are
git checkout staging
and some other commands which I guess are not related, and then
$ git checkout B03799
warning: refname 'B03799' is ambiguous.
Switched to branch 'B03799'
When I tried to reapply the stashed changes, it failed
$ git stash show -p stash@{0} | git apply -R
<stdin>:9: trailing whitespace.
...
<stdin>:18: trailing whitespace.
...
<stdin>:29: trailing whitespace.
...
<stdin>:116: trailing whitespace.
...
<stdin>:117: trailing whitespace.
....
error: patch failed: xxx.cs:24
error: xxx.cs: patch does not apply
I am not sure if I have provided enough information. What are some possible reason that caused the failure of reapplying the stashed changes?
This is my first time using git stash
, and I really hope to avoid misusing it and to utilize its power, if you could let me know some possibilities which can cause reapplying stashed changes to fail.
Thanks.