6 ms·
man git stash
by Estragon 10y ago
man git stash
- jdfellow 10y agoalso very handy for working on multiple branches concurrently, git worktree --help
- kageneko 10y agoI can't trust git stash anymore. I mistyped something and it blew away a lot lot lot of work. So now I just commit stuff. If I want to get rid of the commit, I can follow it up with a reset.
- gcommer 10y agoI use commit amends (`git commit -a`) for continually updating these pseudo-stash commits.
- cname 10y agoIf you can't trust `git stash`, you can't trust git in general, because you can do all kinds of destructive things (which are usually recoverable).
- dahart 10y agoNot true. From the git stash man page: "If you mistakenly drop or clear stashes, they cannot be recovered through the normal safety mechanisms." Git stash is more dangerous than other git commands, and I've personally witnessed more people losing work with stash accidents than with commit accidents. There may be plumbing commands that can get you there like fsck but the fact of the matter is you are better off committing or branching, from a safety standpoint.