Recover uncommitted changes

Deleting an uncommitted file is a rare yet painful event. Especially if we have spent a couple of hours working on it. It’s useful to know there’s a chance to recover the change. If the change has been staged we can find it as a dangling blob with git fsck1. Git will create a dangling blog every time we stage a change. So even if we remove a file or stage another change on top of the old one theoretically, we’ve got a chance to recover. ...

19 Jun 2024 · 2 min · 341 words

Improve your git stash workflow in fugitive

If you’re a vim/neovim user and your git interactions are through vim-fugitive1. By some point, you probably needed to stash some work. And you probably use the fugitive :Git stash command. But plain git stash will create a stash with a random hash. $ git stash Saved working directory and index state WIP on main: 44bc329 The annoying part is when you have more than one stash, and you need to remember the hash. If you use git stash save you can provide a proper name for your stash. ...

11 Sep 2023 · 3 min · 599 words