We're sorry but this app doesn't work properly without JavaScript enabled. Please enable it to continue.

This lesson's interactive features are locked, please to keep using them

Fast Forward Merge

The simplest type of merge is a fast-forward merge. Let's say we start with this:

      C     feature_1
     /
A - B       main

And we run this while on main:

git merge feature_1

Because feature_1 has all the commits that main has, Git automatically does a fast-forward merge. It just moves the pointer of the "base" branch to the tip of the "feature" branch:

            feature_1
A - B - C   main

Notice that with a fast-forward merge, no merge commit is created.

Happy path: keep main behind feature_1, then use Merge while main is checked out. If you add a commit to main first, the branches will diverge and it will stop being a fast-forward merge.

Interactive example available with JavaScript enabled.

This is a common workflow when working with Git on a team of developers:

  1. Create a branch for a new change
  2. Make the change
  3. Merge the branch back into main (or whatever branch your team dubs the "default" branch)
  4. Remove the branch
  5. Repeat

Assignment

Because the add_classics branch has been merged into main, we don't need it anymore.

git branch -d add_classics

Run and submit the CLI tests from the update_titles branch.