Question

Using cvs, git or another technique (file system level?), I would like to:

  1. Make modifications on branch A

  2. 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

  3. Make modifications on branch B

  4. 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.

Was it helpful?

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.

http://book.git-scm.com/4_stashing.html

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top