Save/restore git/cvs checkout changes when switching branches?
Question
Using cvs, git or another technique (file system level?), I would like to:
Make modifications on branch A
Checkout branch B: Changes to branch A are "stowed away" (by name would be nice), branch B is checked out such that my branch A changes are gone
Make modifications on branch B
Checkout branch A: Changes to branch B are "stowed away" (by name would be nice), branch A is checked out such that my branch B changes are gone but now my "saved" branch A changes from Step #2 are back
Git-stash does not appear to fit the flow I'm describing although my impression could be wrong.
Techniques involving RCS's or file system or command-line tools or otherwise are welcome.
Solution
git stash is the tool you are looking for
# hack on A
git stash
git checkout B
# hack on B
git stash
git checkout A
git stash list # this is only to check which stash you want to pop
git stash pop stash@{1}
this should work
OTHER TIPS
How does git-stash not fit your workflow, beyond not happening automatically? This sounds like exactly what git-stash is for.