0

the terminal running screenshot

1.I have some changes in Branch_A, and a new Branch_B;
2.In Branch_A, Use git stash;
3.checkout to Branch_B, use git stash pop; but get git stash drop in the picture above;
4.git stash list get no stash entry;

Why is there such a strange error in step 3?

Meng Shi
  • 1
  • 1
  • 1
    Nothing curious at all, if you know what `git stash pop` does. By default, pop will apply the stash _and_ then pop it (read: delete it) from the stack of stashes. In general, `git stash apply` is therefore preferred, because it does not delete the stash, in case you would want to apply it again a second time. – Tim Biegeleisen Dec 20 '19 at 02:29
  • @TimBiegeleisen i know this delete it. But all my changes are lost after `git stash pop`; i get no changes in the new Branch – Meng Shi Dec 20 '19 at 02:43
  • 1
    Yes, and if you read the duplicate link, you will found out why this is the case. – Tim Biegeleisen Dec 20 '19 at 02:44
  • I wonder why my code changes didn't pop up – Meng Shi Dec 20 '19 at 02:44

0 Answers0