

0 / 2 embers
0 / 3000 xp
click for more info
Complete a lesson to start your streak
click for more info
Difficulty: 4
click for more info
Not enough gems
Cost: 6 gems
1: Merge
incomplete
2: Merge Commits
incomplete
3: Merge Log
incomplete
4: Fast Forward Merge
incomplete
5: Fast Forward Commit
incomplete
This lesson's interactive features are locked, please to keep using them
A merge commit is the result of merging two branches together.
Click to play video
Let's say we start with this:
A - B - C main
\
D - E feature_1
And we merge feature_1 into main by running this while on main:
git switch main
git merge feature_1
The merge will:
A.main, starting from the best common ancestor, into a new commit.feature_1 onto main, starting from the best common ancestor.F.F is special because it has two parents, C and E.After:
A - B - C - F main
\ /
D - E feature_1
Happy path: keep main checked out. If you want to make the branches diverge more first, add one commit on main and one on feature_1, then use Merge while still on main to create a two-parent merge commit.
Interactive example available with JavaScript enabled.
Your current webflyx commit history should look like this:
A - B - C - E main
\
D add_classics
Run and submit the CLI tests while still on main.
Remember, if you mess up a commit message, you can change it with the --amend flag. For example:
git commit --amend -m "F: Merge branch 'add_classics'"
If you prefer a GUI editor over Vim, you can set one as your default:
# Zed
git config --global core.editor "zed --wait"
# VS Code
git config --global core.editor "code --wait"
To save and exit the editor: