Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the most recent stash in Git, zero index or the biggest index?

Tags:

git

git-stash

I have several items in stash. How can I know which one is the most recent? I need to apply the most resent changes back.

$ git stash list
stash@{0}: WIP on MD-1098: 96e121d8 MD-1098
stash@{1}: WIP on MD-1098: 0aaa2ae5 MD-1098
stash@{2}: WIP on MD-1098: 04c86108 MD-1098
like image 557
Green Avatar asked Oct 26 '25 08:10

Green


1 Answers

Stash Index zero (0) is the latest.

Stashes start with index 0 (as the first stash) and then they are shifted by one on every stash add. So always the new stash is index 0 and the rest are incremented by one

like image 135
Ioannis Barakos Avatar answered Oct 28 '25 22:10

Ioannis Barakos



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!