Company
Date Published
Author
Greg Foster
Word count
1009
Language
English
Hacker News points
None

Summary

Developers frequently face the choice between merging and rebasing when integrating changes from one branch into another in a git repository. While both approaches have their merits, the trend among fast-moving companies and large repositories is increasingly favoring a rebase-centric workflow, particularly in the context of trunk-based development. This approach is seen as beneficial for creating a cleaner, more understandable history by avoiding the clutter of merge commits and maintaining a linear trunk branch. Rebasing offers advantages such as easier reversion of commits and avoidance of the complexities associated with long-lived branches, which are less common in closed-source development environments. However, rebasing can be intimidating due to the complexity of Git commands and the frequent need for force pushes, which clutter the GitHub PR timeline. Tools like the Graphite CLI and platforms like Facebook's Phabricator help automate and simplify the process, promoting the adoption of a squash-rebase-merge workflow. Despite some challenges, the shift toward rebasing is evident among large tech companies and newer repositories, driven by the desire for efficient and clean code integration practices.