by adamsilkey · 2y ago · 0 comments
Have you ever squashed down a branch before merging back into main? Then you've used rebase.
The purpose of source control (not just git) is to keep a useful version history of your project. If you don't need to know where/when a commit originally branched off from, rebase can keep a cleaner history than merge.
Even rebasing a branch off the latest commit just to merge back in can be useful.
In popular Git ecosystems like Github you have the option to add a merge commit. To me, this also helps understanding the history of the repo. Would the rebasing be equally visible?
Git is a powerful data structure manipulation tool. Use it as such and harvest that power. After all, what you're working on is just a graph of repository states - and you can attach any meaning you find useful to those states.