4 ms·
Your organization has chosen a poor workflow. Developers should never be required to produce and merge "feature branches" but only properly rebased sequences o
by kazinator 6y ago
Your organization has chosen a poor workflow.
Developers should never be required to produce and merge "feature branches" but only properly rebased sequences of commits which keep the history linear.
With a rebase workflow, you can juggle multiple changes in the same branch (your local main branch that tracks the remote master).
I sometimes have as many as five or six separate work items going on. This is much more productive than switching among five or six branches which don't know about each other, not only due to the convenience, but also due to the integration: all six things build together and are being tested in the same image.
Git has a great "interactive rebase" feature (git rebase -i) for rearranging the order of your local commits, and combining them together. Thanks to interactive rebase, I submit properly rebased versions off all six of those items to the review system.
It's also worth learning how to use "git commit --fixup" and its variant "--squash", together with "git rebase -i --autosquash". You can make commits which are amendments to commits that are not the current HEAD. The auto-squash rebase will automatically put these commits in the right order, and configure them to be combined with their target commits. I have the --autosquash option set up implicitly in the global config.
Code review is an excellent process. I've been saved from silly mistakes more times than I can remember, and have saved others. When I'm working on my solo side projects, I'm keenly aware of the lack of review now. I've screwed up many times in ways that a second pair of eyes could have prevented.