0
0
Gitdevops~5 mins

Why rebasing creates linear history in Git - Quick Recap

Choose your learning style9 modes available
Recall & Review
beginner
What does rebasing do to your commit history in Git?
Rebasing moves your branch's commits to start from the latest commit of the target branch, creating a straight, linear sequence of commits.
Click to reveal answer
intermediate
How does rebasing differ from merging in terms of commit history?
Merging combines branches by creating a new merge commit, preserving the branch structure, while rebasing rewrites commits to create a linear history without merge commits.
Click to reveal answer
beginner
Why is a linear history beneficial in Git?
A linear history is easier to read and understand because it shows a clear, step-by-step progression of changes without complex branching paths.
Click to reveal answer
intermediate
What happens to your commits during a rebase?
Your commits are temporarily saved, the branch is moved to the new base commit, then your commits are reapplied one by one on top of that base.
Click to reveal answer
intermediate
Can rebasing change commit hashes? Why?
Yes, because rebasing creates new commits based on the old ones but with a different parent, resulting in new commit hashes.
Click to reveal answer
What is the main effect of rebasing a branch in Git?
AIt deletes all commits on the branch.
BIt creates a linear commit history by moving commits.
CIt merges two branches with a merge commit.
DIt creates a new branch without commits.
Which Git command rewrites commit history to be linear?
Agit merge
Bgit stash
Cgit clone
Dgit rebase
What does rebasing do to commit hashes?
AChanges them because commits are recreated
BDeletes them
CKeeps them the same
DMerges them
Why might developers prefer rebasing over merging?
ATo delete branches
BTo create more merge commits
CTo keep a clean, linear history
DTo avoid pushing changes
What happens to your commits during a rebase?
AThey are saved, branch is moved, then reapplied
BThey are deleted permanently
CThey are merged into one commit
DThey are pushed to remote automatically
Explain in your own words why rebasing creates a linear history in Git.
Think about how commits are moved and reapplied on top of another branch.
You got /5 concepts.
    Describe the difference between rebasing and merging regarding commit history.
    Consider how each command affects the shape of the commit graph.
    You got /5 concepts.