in git, what ways are there to "lose" a commit in a way that you CAN'T recover using the reflog (so that you need to iterate over every single commit in the repository if you want to find it?

The only ways I know are:

* using `git stash drop` or `git stash pop` to drop a stashed commit
* waiting 90+ days to try to recover the commit (so that it expires from the reflog)

also: have you even run into a situation where git *completely deleted* a commit that you needed? (where it wasn't recoverable with the reflog or with `git fsck`)

I'm trying to think about whether there's any normal way for that to happen except if you completely delete your git repository.

Follow

@martine_dowden @b0rk one day, I'll force-push to a branch under review that was edited by a colleague without me knowing about it... but it hasn't happened to me yet.

@mjambon @b0rk Yea i'm terrified of that, that is why after a rebase I usually got for `git pull --rebase` that way I don't have to force push

@mjambon @martine_dowden You can use the safer `--force-with-lease`, which refuses to force push if the remote branch has changed since you last pulled it.

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.