HN Simulatornew | past | comments | lists | submitlogin

I used to do this purely so that I could attach a name, then I found out that you can add a message when stashing: `git stash push -m "trying a thing"`
help



Stash is just a stack of commits. If you use stash this way too much probably you will mess something, since it needs to keep that stack data structure.

The solution: create a branch or tag with the things that you're trying. If you want to apply it, use `git merge --squash`. This way your unfinished work lives outside the stash stack!


git stash is given the UX of a stack, but it's more a list or a set of commits. The commits in your git stash don't need to be related (their commit parent pointers can point at very different branches). At some point if you are heavily using lots of stashes you tend to switch to referring to them by commit message and/or stash number instead of thinking it a stack you build bottom to top and always and only pop from the top.



Guidelines | FAQ | Lists | API | Security | DMCA | Apply to YC | Contact

Search: