0
0
Gitdevops~5 mins

Rebase vs merge mental model in Git - Quick Revision & Key Differences

Choose your learning style9 modes available
Recall & Review
beginner
What does git merge do in simple terms?
It combines the histories of two branches by creating a new commit that joins them together, keeping all previous commits intact.
Click to reveal answer
beginner
What is the main effect of git rebase?
It moves or 'replays' your branch commits on top of another branch, creating a cleaner, linear history without merge commits.
Click to reveal answer
intermediate
How does git merge affect commit history compared to git rebase?
git merge preserves the exact history and shows branches joining, while git rebase rewrites history to look like a straight line.
Click to reveal answer
intermediate
Why might you choose git rebase over git merge?
To keep a clean, easy-to-follow project history without extra merge commits, making it look like changes happened in a straight line.
Click to reveal answer
advanced
What is a risk of using git rebase on shared branches?
Rebasing rewrites history, so if others share the branch, it can cause confusion and conflicts when they try to update their copies.
Click to reveal answer
What does git merge create when combining branches?
ADeletes the old branch
BA new commit that joins the branches
CRewrites all commits in a linear order
DRemoves conflicts automatically
Which command rewrites commit history to make it linear?
Agit merge
Bgit clone
Cgit rebase
Dgit commit
Why should you be careful using git rebase on shared branches?
AIt can cause conflicts by rewriting history others rely on
BIt slows down the repository
CIt merges branches automatically
DIt deletes the branch permanently
Which is a benefit of using git merge?
ADeletes old commits
BCreates a linear history
CRemoves all conflicts
DKeeps all branch history intact
What is a visual difference in history between merge and rebase?
AMerge shows branches joining; rebase shows a straight line
BMerge deletes commits; rebase duplicates commits
CMerge rewrites history; rebase preserves history
DMerge creates conflicts; rebase removes branches
Explain in your own words the difference between git merge and git rebase.
Think about how the project history looks after each command.
You got /5 concepts.
    When would you prefer to use git rebase instead of git merge?
    Consider the goal of a tidy project history.
    You got /4 concepts.