

0 / 2 embers
0 / 3000 xp
click for more info
Complete a lesson to start your streak
click for more info
Difficulty: 3
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
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:
main (or whatever branch your team dubs the "default" branch)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.