From the course: Use Git Like a Pro by Pearson

Unlock this course with a free trial

Join today to access over 25,600 courses taught by industry experts.

Merging vs. rebasing

Merging vs. rebasing

Let's recap the differences between merging and rebase. So we saw that with merging, it's going to be a three-way merge, which means Git is going to create an additional merge commit. However, with rebasing, no merge commit is created because it's always a fast-forward merge. Now, whether to use Merge or Rebase, it depends on your personal preference, or also on what you have decided as a team in your project. Some people like to see the cleaner history, so they prefer Rebase. However, there are different benefits of using Merge, so some people prefer Merging. The major benefit of Rebasing is that you get a much cleaner project history. There are no unnecessary merge commands required by git merge. So git rebase creates a linear history which makes it easy to navigate the project with git log or git bisect commands. However, there are also some pitfalls using git rebase. Since git rebase rewrites the history, it can be dangerous in terms of collaboration if you don't follow the golden…

Contents