Atlassian has an excellent article on git’s
rebase. When first learning git, I was told to avoid
rebase like the plague. The article explains it with more nuance:
As an alternative to merging, you can rebase the feature branch onto master branch using the following commands:
git checkout feature git rebase master
This moves the entire
featurebranch to begin on the tip of the
masterbranch, effectively incorporating all of the new commits in master. But, instead of using a merge commit, rebasing re-writes the project history by creating brand new commits for each commit in the original branch.
Rebasing seems most useful for cleaning up local commits. Interactive rebasing looks like a very cool tool, too. Definitely worth looking in to. There’s also very good illustrations.