0
0
Gitdevops~5 mins

Merge strategies overview in Git - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What is a merge strategy in Git?
A merge strategy is the method Git uses to combine changes from different branches into one. It decides how to integrate the histories and content.
Click to reveal answer
intermediate
Explain the recursive merge strategy.
The recursive strategy is Git's default. It handles two-parent merges by creating a new merge commit that combines changes from both branches, resolving conflicts if needed.
Click to reveal answer
intermediate
What does the ours merge strategy do?
The 'ours' strategy keeps the current branch's content and ignores changes from the other branch during a merge. It is useful to override changes.
Click to reveal answer
advanced
Describe the octopus merge strategy.
The octopus strategy merges more than two branches at once. It works best when there are no conflicts and creates a single merge commit.
Click to reveal answer
beginner
What is a fast-forward merge?
A fast-forward merge happens when the current branch has no new commits since branching. Git just moves the pointer forward without creating a merge commit.
Click to reveal answer
Which merge strategy is the default in Git?
Arecursive
Bours
Coctopus
Dfast-forward
What does a fast-forward merge do?
ACreates a new merge commit
BMoves the branch pointer forward without a merge commit
CIgnores changes from the other branch
DMerges multiple branches at once
When is the octopus merge strategy used?
ATo keep only the current branch's changes
BTo merge two branches with conflicts
CTo merge multiple branches at once without conflicts
DTo rebase commits
What happens with the 'ours' merge strategy?
AKeeps changes from the current branch only
BCreates a merge commit combining both branches
CKeeps changes from the other branch
DDeletes the current branch
Which merge strategy creates a new commit combining two branches?
Afast-forward
Boctopus
Cours
Drecursive
Describe the main differences between fast-forward and recursive merge strategies in Git.
Think about whether a new commit is created or not.
You got /4 concepts.
    Explain when and why you might use the 'ours' merge strategy.
    Consider a situation where you want to discard incoming changes.
    You got /4 concepts.