0
0
Gitdevops~10 mins

Reading conflict markers in Git - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to start resolving a merge conflict by opening the conflicted file.

Git
git [1]
Drag options to blanks, or click blank then click option'
Astatus
Bcommit
Cdiff
Dmerge
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'git commit' before resolving conflicts
Using 'git merge' without specifying branches
Using 'git diff' without context
2fill in blank
medium

Complete the command to view the conflict markers inside a file named app.js.

Git
git [1] app.js
Drag options to blanks, or click blank then click option'
Alog
Bdiff
Cbranch
Dcheckout
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'git log' which shows commit history
Using 'git branch' which manages branches
Using 'git checkout' which switches branches or files
3fill in blank
hard

Fix the error in the conflict marker syntax shown below by completing the missing marker line.

Git
<<<<<<< HEAD
console.log('Version A');
[1]
console.log('Version B');
>>>>>>> feature-branch
Drag options to blanks, or click blank then click option'
A<<<<<<<
B>>>>>>>
C=======
DHEAD
Attempts:
3 left
💡 Hint
Common Mistakes
Using '>>>>>>>' instead of '======='
Using '<<<<<<<' again instead of the separator
Using branch names as markers
4fill in blank
hard

Fill both blanks to complete the conflict markers for a file with conflicts.

Git
<<<<<<< [1]
code from first branch
[2]
code from second branch
>>>>>>> branch-name
Drag options to blanks, or click blank then click option'
AHEAD
B=======
Cfeature-branch
Dorigin/main
Attempts:
3 left
💡 Hint
Common Mistakes
Using branch names in the first blank instead of HEAD
Using branch names instead of the separator line in the second blank
5fill in blank
hard

Fill all three blanks to correctly identify the conflict markers and branch names in a merge conflict.

Git
<<<<<<< [1]
code from first branch
[2]
code from second branch
>>>>>>> [3]
Drag options to blanks, or click blank then click option'
AHEAD
B=======
Cfeature-branch
Dmain
Attempts:
3 left
💡 Hint
Common Mistakes
Mixing up branch names in the start and end markers
Using incorrect symbols for the separator
Omitting the HEAD marker