0
0
Gitdevops

Reading conflict markers in Git - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What are conflict markers in Git?
Conflict markers are special lines Git adds to files when it can't automatically merge changes. They show where the conflicts are so you can fix them.
Click to reveal answer
beginner
Identify the three parts of a Git conflict marker.
The three parts are: <<<<<<< HEAD (your changes), ======= (separator), and >>>>>>> branch-name (incoming changes).
Click to reveal answer
beginner
What does the line starting with <<<<<<< mean in a conflicted file?
It marks the start of your current branch's version of the conflicting code.
Click to reveal answer
beginner
What should you do after seeing conflict markers in your file?
You should read the conflicting sections, decide which code to keep or combine, remove the conflict markers, and then save the file.
Click to reveal answer
beginner
Why does Git add conflict markers instead of merging automatically?
Git adds conflict markers when it can't decide which changes to keep because both branches changed the same part of the file differently.
Click to reveal answer
What does the ======= line in a Git conflict marker separate?
ATwo unrelated files
BThe start and end of the file
CThe commit message and the code
DYour changes and the incoming changes
Which marker shows the incoming branch's changes in a conflict?
A<<<<<<< HEAD
B>>>>>>> branch-name
C=======
D# Conflict start
What is the first step to resolve a Git conflict after seeing conflict markers?
ARead and understand the conflicting sections
BDelete the file
CCommit the file immediately
DRun git push
If you want to keep only your changes in a conflict, what should you do?
AKeep all code including markers
BKeep the code after =======
CKeep the code between <<<<<<< HEAD and =======, remove the rest
DDelete the entire file
Why might Git not be able to merge automatically?
ABecause both branches changed the same lines differently
BBecause the commit messages are missing
CBecause the internet is slow
DBecause the files are too large
Explain what conflict markers look like in a Git file and what each part means.
Think about how Git shows your version and the other branch's version.
You got /6 concepts.
    Describe the steps you take to resolve a file with Git conflict markers.
    Focus on understanding, editing, and finalizing the file.
    You got /5 concepts.