When working with multiple feature branches in parallel, I need to stash
or commit
the local changes before I can switch to another branch. I think both stash and commit feel rather clumsy to me. Is there a more elegant alternative?
Why stash
is clumsy: I work on multiple branches and switch between them from time to time. Sometimes I end up forgetting to pop, or popping the wrong stash.
Why commit
is clumsy: my changes are work-in-progress. They are not complete and should not be committed. What I end up doing is committing them first (because I'm forced to), and later doing a soft reset so that my previous commit comes back to "local changes". Or, sometimes I let the temporary commits pile up and do an interactive rebase later.
What I'm looking for: like a "smart stash". Stash the local changes automatically when I switch to a another branch, and pop the stash associated with this branch automatically when I switch back. Could this be done?