4 ms·
One place where the stash is really useful is pre-rebase. Unlike in merge, you need a clean worktree before you can rebase irrespective of whether or not those
by artagnon 13y ago
One place where the stash is really useful is pre-rebase. Unlike in merge, you need a clean worktree before you can rebase irrespective of whether or not those worktree changes will be affected by the rebase. A very common workflow on a topic branch:
$ git stash
$ git rebase master
$ git stash pop
To automate this workflow, there is a topic called rr/rebase-autostash that introduces the configuration variable rebase.autostash which will automatically 'stash' and 'stash pop' for you.
The topic is still cooking in git.git, and is due to hit `master` in a few days. If you want to know more, read about it from the `pu` branch of git.git. I've put up the most important commit message here [1] for convenience.
[1]: http://artagnon.com/git-rebase.autostash http://artagnon.com/git-rebase.autostash