Lessons:2Length:4 minutes
  • Overview
  • Transcript

1.2 Git Basics: Merge and Rebase

In this lesson, I’ll show you how to integrate source code changes from one branch to another using either git merge or git rebase. There are some subtle differences between them—for instance, merging preserves the branch history, while rebasing doesn’t. Follow along and I’ll explain when to use one or the other.

Code Snippet

The following snippet will rebase the contents of the branch branch to master, without adding an extra commit message for the merge.

git checkout branch
git rebase master
git checkout master
git merge branch

Related Links

1.Git Basics: Merge and Rebase
2 lessons, 03:57

Free Lesson

Git Basics: Merge and Rebase

1.2 Git Basics: Merge and Rebase

Back to the top