0
0
Gitdevops~5 mins

git merge command - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What does the git merge command do?
It combines changes from one branch into another branch, integrating the histories.
Click to reveal answer
beginner
What is a 'merge conflict' in Git?
A situation where Git cannot automatically combine changes because the same part of a file was changed differently in the branches being merged.
Click to reveal answer
intermediate
How do you resolve a merge conflict?
You manually edit the conflicting files to choose or combine changes, then mark the conflict as resolved by adding the files and committing.
Click to reveal answer
intermediate
What does the command git merge --no-ff do?
It forces Git to create a merge commit even if the merge could be done with a fast-forward, preserving the branch history.
Click to reveal answer
beginner
What is a 'fast-forward' merge?
A merge where the current branch pointer is simply moved forward to the target branch because there are no divergent changes.
Click to reveal answer
What happens when you run git merge feature while on the main branch?
AThe <code>feature</code> branch is deleted.
BChanges from the <code>feature</code> branch are combined into <code>main</code>.
CThe <code>main</code> branch is renamed to <code>feature</code>.
DA new branch called <code>feature</code> is created.
Which command helps you see which files have conflicts after a merge?
A<code>git status</code>
B<code>git log</code>
C<code>git branch</code>
D<code>git checkout</code>
What does a 'fast-forward' merge mean?
AGit resets the repository to an earlier commit.
BGit creates a new merge commit.
CGit deletes the source branch.
DGit moves the branch pointer forward without creating a new commit.
How do you force Git to create a merge commit even if fast-forward is possible?
A<code>git merge --squash</code>
B<code>git merge --force</code>
C<code>git merge --no-ff</code>
D<code>git merge --abort</code>
What should you do after fixing merge conflicts manually?
AAdd the resolved files and commit the merge.
BDelete the branch.
CRun <code>git reset</code>.
DCreate a new branch.
Explain the process and purpose of the git merge command.
Think about how two different versions of a project come together.
You got /4 concepts.
    Describe what a merge conflict is and how you would resolve it in Git.
    Imagine two friends editing the same sentence differently.
    You got /4 concepts.