DEV Community

Discussion on: Git Organized: A Better Git Flow

Collapse
 
mindplay profile image
Rasmus Schultz

This doesn't sound like it'll work.

If you fixed bugs while working on your feature, those bugs are most likely in the same files you were working on.

So you will end up committing unrelated changes this way. Honestly, if this is your strategy, you might as well not commit anything at all, and just commit everything when it's done. (and to be clear, I am not recommending that.)

Having that unrelated bugfix in a separate commit (like you probably had in the first place) you can cherry pick it to the main branch or a separate PR (depending on your workflow) before submitting your feature PR.

It's probably better to work on your commit discipline. Commit in small increments, commit when you're in a working state only, diff and review each change before you commit, and always use the commit log to describe "why" - the "what" is usually obvious from the diff.