3 ms·
This is something where git rebase comes in handy: - Start working on a breaking change - Realize you need to fix something else - Commit your WIP breaking c
by pimlottc 3y ago
This is something where git rebase comes in handy:
- Start working on a breaking change
- Realize you need to fix something else
- Commit your WIP breaking change
- Make and commit the fix
- Rebase your changes to move the fix onto HEAD (before your WIP commits)
- Push the fix
- Continue working on the breaking change
- TylerE 3y agoWhy is all that ceremony better than just doing a git stash?
- pimlottc 3y agoThat's another option, sure! Personally, I tend to make chains of small commits as I'm working, so keeping things in normal commits makes more sense to me. I like having everything clearly linked to the branch I'm working on. It's easier for me to forget what's in a stash and what it relates to. To me, stash just seems like a weird non-standard version of a normal commit without any major benefits.
- TylerE 3y agoI’ve used a feature branch workflow for years, so stashes are localized. Basically except really giant refactors (which are rare, it’s a 20 year old codebase) you just fork off a feature branch. Master really only exists for merges and the occasional get it out right now one liner. I say all this with the caveat that our internal scripts merge master into the feature branch on commit, so it forces you to deal with diff rot early and easily.