So today I learned a thing the painful way. Join me in my pain.

  • You want to pull a remote git update.
  • It won't apply.
  • You stash your changes then pull.
  • You pop your stash.
  • Wild CONFLICT appears!
  • You fix the conflict.
  • You add the fixed file.
  • Wait. Git has held onto the stash. What?
  • Maybe it just needs to be applied fully now the conflict is resolved.
  • You git stash pop.

And at that point, it destroys all of your work from the last four hours. Oh, and the stash is gone. Oh, and it's not in the reflog either. Fuck you.

I will say this. It is a very good job I have my backups set up. If I'm really really lucky, I've only lost half an hour.

Fucking git.

@dave I think I've learned not to use git stash. Better to use a local-only, short-lived branch. I've done what you just did too many times.
@dave I'm messing with jj (https://www.jj-vcs.dev, https://github.com/jj-vcs/jj) on some personal repos and while it lacks the equivalent Magit integration (yes, I'm an Emacs users) the cli interaction is quite nice and way less complex than git. See the Rosetta table https://www.jj-vcs.dev/latest/git-command-table/. A few nice things for me are that changes and new files are auto committed, I can easily have multiple working copies, I don't stash it's just a bookmark, and that I can bookmark a conflict and work around it later.
Redirecting