0
0
Gitdevops~5 mins

Merge commit creation in Git - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What is a merge commit in Git?
A merge commit is a special commit that combines the changes from two branches into one, preserving the history of both branches.
Click to reveal answer
beginner
Which Git command creates a merge commit by default when merging branches?
The command git merge <branch-name> creates a merge commit by default if there are changes to combine.
Click to reveal answer
beginner
What happens if there are no conflicts during a merge?
Git automatically creates a merge commit that combines the changes from both branches without manual intervention.
Click to reveal answer
intermediate
How can you avoid creating a merge commit when merging?
You can use git merge --ff-only <branch-name> to only merge if a fast-forward is possible, avoiding a merge commit.
Click to reveal answer
beginner
What is the purpose of the merge commit message?
The merge commit message explains which branches were merged and why, helping others understand the combined changes.
Click to reveal answer
Which command creates a merge commit in Git?
Agit rebase master
Bgit checkout feature-branch
Cgit commit --amend
Dgit merge feature-branch
What does a merge commit do?
ADeletes the source branch
BCombines changes from two branches
CCreates a new branch
DReverts previous commits
How do you prevent a merge commit during merge?
Agit merge --ff-only
Bgit merge --no-commit
Cgit merge --squash
Dgit merge --abort
What happens if there are conflicts during a merge?
AGit automatically resolves them
BGit creates a merge commit without changes
CYou must manually resolve conflicts before completing the merge
DThe merge is canceled automatically
Which branch is updated after a successful merge commit?
AThe target branch where merge is done
BThe source branch
CBoth branches
DNeither branch
Explain what a merge commit is and why it is important in Git.
Think about how two sets of changes come together in one place.
You got /4 concepts.
    Describe the steps Git takes when creating a merge commit and what happens if there are conflicts.
    Consider what Git does automatically and what needs your help.
    You got /4 concepts.