markjgsmith

Linkblog

06:10:00 +07:00 Git branches: intuition & reality - There's definitely confusion in this area, but for me it isn't around the concept of a branch. I'm happy with my mental model of a branch. However I've always been confused by the concept of a rebase, while I'm happy with the idea of a merge. Though the article was looking at it from a different angle than I would have liked, the diagrams midway through that compares a simple rebase with a simple merge make a lot of sense. The rebase basically squeezes in all the latest commits from main, shoving them below the common ancestor, thus re-creating the base that the feature branch is built on. Presumably this results in a branch that has a more full history, whereas a branch updated via merge has loads of code appearing all in one go at the merge point. The article doesn't go into that, which is a bit of a shame. I'm going to continue favoring merges, for now I'm still not convinced that rebases are worth the trouble. # jvns.ca

For enquiries about my consulting, development, training and writing services, aswell as sponsorship opportunities contact me directly via email. More details about me here.