4 ms·
I have a similar problem; this is what I do: I keep a dev branch to merge to/from whenever I switch focus. For example, when I'm on branch Feat-A, but I want
by news_to_me 13y ago
I have a similar problem; this is what I do: I keep a dev branch to merge to/from whenever I switch focus.
For example, when I'm on branch Feat-A, but I want to make a change related to Feat-B (or I already have but haven't committed), I'll stash my changes, merge Feat-A into dev, merge dev into Feat-B, pop my changes off the stash, and commit.
The whole switch goes:
- "Oops, these changes don't go on this branch"
- git stash
- git checkout dev
- git merge Feat-A
- git checkout Feat-B
- git merge dev
- git stash pop
It takes half a minute, but it keeps my branches clean, and lets me move from feature to feature at will. I may add a 'git oops' alias just for this process.
- scoot 13y agoThank you - I've been meaning to think that process through. I'll be doing this from now on if I'm in the same situation rather than 'ah feck it, commit it'!
- easy_rider 13y agoyepyep, this is also how i roll; stashing and popping!