poll: if you use `git stash`, do you use `git stash pop` or `git stash apply` to retrieve your code from the stash?

another poll: if you use `git stash`, have you ever lost work because of it?

(you can pick more than one)

@b0rk

It's not obvious (and you probably already know this), but stash has its reflog, so failed pop doesn't destroy the thing you popped. Alas, it can destroy the changes in the work tree you popped onto.

@robryk i find the stash's reflog so weird -- definitely a failed pop doesn't destroy the thing you popped, but if you pop in the wrong place (and it applies successfully), then it will destroy the thing you popped.

it feels so counter to the whole point of the reflog to me that the stash will delete things from its reflog

Follow

@b0rk huh, I must be mistaken about something because I thought that stash's reflog behaves normally. Thanks, will take a look at it when I'm next at something more computer-like than a phone.

@robryk yeah it's super weird -- basically stash treates the reflog like a stack instead of it being append only

@b0rk oh. Then I was mistaken and you can lose the thing being popped :( (I assume it doesn't get added to the global reflog?)

@b0rk so the only way to get it back is to find the hash in terminal scroll back. Sigh...

@robryk someone pointed out a while back that you can also use git fsck

Sign in to participate in the conversation
Qoto Mastodon

QOTO: Question Others to Teach Ourselves
An inclusive, Academic Freedom, instance
All cultures welcome.
Hate speech and harassment strictly forbidden.