As much as I've tried to avoid it, I have to maintain three master
-equivalient branches with minor changes in each one. I've been reading about git
and using it for a couple of years, so I'm familiar with the following conventional wisdom:
- Don't
merge
unless it is meaningful. Userebase
instead. - If you just need to pull in one commit,
cherry-pick
is your friend. - Always
pull --rebase
on the remote before pushing. - Keep features in line with
rebase
.
What they don't tell you is the conventional wisdom creates a bunch of commits that are nearly identical, except for minor details that change their SHA1s. Why does this matter? It defeats the purpose of comparing branches with git log --left-right --graph --cherry-pick --oneline branch1..branch2
and git show-branch
, which is especially annoying. Feels like an abuse of cheap branching. It makes it nearly impossible to see which patches are missing from each branch.
So, how do you keep multiple branches in line with identical SHA1s so these tools can be used? Are patches the best way to do this?