Recall & Review
beginner
What is a fast-forward merge in Git?
A fast-forward merge happens when the branch you want to merge has all the new commits ahead of the current branch, so Git just moves the current branch pointer forward without creating a new commit.
Click to reveal answer
beginner
When does Git perform a fast-forward merge automatically?
Git performs a fast-forward merge automatically when the current branch has no new commits since the branch to merge started, meaning the current branch can just move forward to the target commit.
Click to reveal answer
intermediate
How do you prevent Git from doing a fast-forward merge?
You can prevent a fast-forward merge by using the command
git merge --no-ff <branch>, which forces Git to create a merge commit even if a fast-forward is possible.Click to reveal answer
intermediate
What is the visual difference between a fast-forward merge and a regular merge?
A fast-forward merge moves the branch pointer forward in a straight line, while a regular merge creates a new commit that joins two branches, showing a branch and merge structure in the history.
Click to reveal answer
intermediate
Why might you choose to avoid fast-forward merges?
Avoiding fast-forward merges keeps the history clearer by showing when branches were merged, which helps understand the project timeline and review changes better.
Click to reveal answer
What does a fast-forward merge do in Git?
✗ Incorrect
A fast-forward merge simply moves the branch pointer forward when no new commits exist on the current branch.
Which command prevents Git from doing a fast-forward merge?
✗ Incorrect
Using --no-ff forces Git to create a merge commit even if a fast-forward is possible.
When is a fast-forward merge NOT possible?
✗ Incorrect
If the current branch has new commits, Git cannot just move the pointer forward; it needs a merge commit.
What does the Git history look like after a fast-forward merge?
✗ Incorrect
Fast-forward merges keep history linear without extra merge commits.
Why might developers prefer to create merge commits instead of fast-forward merges?
✗ Incorrect
Merge commits help track the integration points of branches clearly in history.
Explain what a fast-forward merge is and when Git uses it.
Think about how Git moves the branch pointer when no new commits exist on the current branch.
You got /3 concepts.
Describe how to force Git to create a merge commit even if a fast-forward merge is possible and why you might want to do that.
Consider how to keep the project history easier to understand.
You got /3 concepts.