

Rebasing is a common way to integrate upstream changes into your local repository. The following diagram demonstrates how rebasing onto the main branch facilitates a fast-forward merge. The former option results in a 3-way merge and a merge commit, while the latter results in a fast-forward merge and a perfectly linear history. You have two options for integrating your feature into the main branch: merging directly or rebasing and then merging. Learn more about git log and git bisect on their individual usage pages. The developer quickly finds the commit that introduced the bug and is able to act accordingly.

Internally, Git accomplishes this by creating new commits and applying them to the specified base.

The general process can be visualized as the following:įrom a content perspective, rebasing is changing the base of your branch from one commit to another making it appear as if you'd created your branch from a different commit. Rebasing is most useful and easily visualized in the context of a feature branching workflow. Rebasing is the process of moving or combining a sequence of commits to a new base commit.
