3 ms·
Except for saving some typing, is there any benefit to stash over local branches? In other words, shouldn't git just fix ux for branches and rip out stash?
by e12e 9y ago
Except for saving some typing, is there any benefit to stash over local branches?
In other words, shouldn't git just fix ux for branches and rip out stash?
- OJFord 9y agoSo "some typing" would be: # git stash: prev_ref="$(git rev-parse --abbrev-ref HEAD)" git checkout -b wip-stash git add . git commit -m 'wip stuff' git checkout "$prev_ref" # git stash pop: git checkout wip-stash -- . git checkout -D wip-stash It's quite a considerable saving. I suppose by "fix UX" you mean make it so the saving would be less anyway, but I think really they're just conceptually different: - branch: pointer to a line of history, i.e. a commit and inherently its ancestors - stash: a single commit-like dump of patches If stashing disappeared from git tomorrow, I think I'd use orphan commits rather than branches to replace it.