


This moves the entire feature branch to begin on the tip of the main branch, effectively incorporating all of the new commits in main. The easiest option is to merge the main branch into the feature branch using something like the following: To incorporate the new commits into your feature branch, you have two options: merging or rebasing. Now, let’s say that the new commits in main are relevant to the feature that you’re working on. This results in a forked history, which should be familiar to anyone who has used Git as a collaboration tool. Both of these commands are designed to integrate changes from one branch into another branch-they just do it in very different ways.Ĭonsider what happens when you start working on a new feature in a dedicated branch, then another team member updates the main branch with new commits. The first thing to understand about git rebase is that it solves the same problem as git merge. In this article, we’ll compare git rebase with the related git merge command and identify all of the potential opportunities to incorporate rebasing into the typical Git workflow. The git rebase command has a reputation for being magical Git voodoo that beginners should stay away from, but it can actually make life much easier for a development team when used with care.
