I created a new Branch before I started dev on something experimental. I usually forget that (which isn’t a problem), but now I did it beforehand.
Since then I have updated 3 files.
- In 2 are only experimental changes that I DON’T want committed to the safe branch.
- In 1 are only safe (minor) changes that I definitely DO want committed to the safe branch. I’m fine with these last changes to be committed to the new branch as well (but rather not).
Is it possible – I’m sure it is – to (quickly) commit a few unstaged, uncommitted changes from my (dirty) working dir to an old, safe branch?
The only thing I can think of is switching branches (without checkout), commit the changes in 1 file and switch back, but I don’t know what will have happened to the changes when switched back to the dirty branch (are they still there or did they ‘vanish’ due to the commit?)…
I’m sure GIT has something beautiful for this, but GIT has so much, I can’t find the exact same thing.
(I’ve been using this ‘manual’ for help but I’m not sure the same exact thing is in there. If it is (and you’re willing to scan the thing), please let me know, so I know next time to look harder.)
Thanks! For now I’ll just keep a piece of paper handy with changes ‘to commit to safe branch later’.
So your situation is
And you want to go to
You could: