0
0
Gitdevops~5 mins

Resolving merge conflicts in Git - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What is a merge conflict in Git?
A merge conflict happens when Git cannot automatically combine changes from two branches because the same part of a file was changed differently in each branch.
Click to reveal answer
beginner
How does Git mark the conflicting areas in a file?
Git uses special markers like <<<<<<<, =======, and >>>>>>> to show the conflicting parts from each branch inside the file.
Click to reveal answer
beginner
What is the first step to resolve a merge conflict?
Open the conflicted file, find the conflict markers, and decide how to combine or choose between the changes.
Click to reveal answer
beginner
Which Git command do you use to mark a conflict as resolved after editing?
Use git add <filename> to mark the conflict as resolved before committing.
Click to reveal answer
beginner
What command finalizes the merge after resolving conflicts?
Run git commit to complete the merge once all conflicts are resolved and staged.
Click to reveal answer
What does Git use to show conflicting changes inside a file?
ASeparate files for conflicts
BColor codes only
CNo indication, manual check needed
DSpecial markers like <<<<<<< and >>>>>>>
After fixing a merge conflict in a file, what is the next Git command to run?
Agit clone
Bgit add <filename>
Cgit push
Dgit merge
What causes a merge conflict in Git?
ATwo branches change the same lines differently
BBranches have different names
CFiles are too large
DNo internet connection
Which command completes the merge after resolving conflicts?
Agit commit
Bgit status
Cgit branch
Dgit reset
If you want to abort a merge and return to the previous state, which command do you use?
Agit reset --hard
Bgit checkout master
Cgit merge --abort
Dgit stash
Explain the steps you take to resolve a merge conflict in Git.
Think about what Git shows you and how you fix it step by step.
You got /6 concepts.
    What are the common causes of merge conflicts and how can you avoid them?
    Consider why conflicts happen and good teamwork habits.
    You got /5 concepts.