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

Merge

"What's the point of having multiple branches?" you might ask. They're most often used to safely make changes without affecting your (or your team's) primary branch. However, once you're happy with your changes, you'll want to merge them back into the main branch so that they make their way into the final product.

Click to play video

Visual

Let's say you're in a state where you have two branches, each with their own unique commits:

A - B - C    main
   \
    D - E    other_branch

If you merge other_branch into main, Git combines both branches by creating a new commit that has both histories as parents. In the diagram below, F is a merge commit that has C and E as parents. F brings all the changes from D and E back into the main branch.

A - B - C - F    main
   \     /
    D - E        other_branch

Assignment

# contents

- titles.md: The movie titles in the WebFlyx collection
- classics.csv: A comma-separated list of classic movies
- quotes: A directory of files containing memorable quotes from movies
A - B - C - E    main
         \
           D     add_classics

Run git log --oneline --graph --all and you should see a nice ASCII art representation of your commit history.

Run and submit the CLI tests.