0
0
Gitdevops~10 mins

Ours vs theirs in conflicts in Git - Interactive Practice

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

Complete the command to keep your changes during a merge conflict.

Git
git checkout --[1] -- <file>
Drag options to blanks, or click blank then click option'
Aours
Btheirs
Cbase
Dindex
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'theirs' instead of 'ours' will keep the other branch's changes.
2fill in blank
medium

Complete the command to keep the other branch's changes during a merge conflict.

Git
git checkout --[1] -- <file>
Drag options to blanks, or click blank then click option'
Astaged
Bours
Cbase
Dtheirs
Attempts:
3 left
💡 Hint
Common Mistakes
Confusing 'ours' and 'theirs' options.
3fill in blank
hard

Fix the error in the command to resolve a conflict by choosing your version.

Git
git checkout [1] <file>
Drag options to blanks, or click blank then click option'
Atheirs
B--ours
C--theirs
Dours
Attempts:
3 left
💡 Hint
Common Mistakes
Omitting the double dash causes Git to treat it as a file name.
4fill in blank
hard

Fill both blanks to create a command that resets a conflicted file to the other branch's version and stages it.

Git
git checkout [1] -- [2]
Drag options to blanks, or click blank then click option'
A--theirs
Bfile.txt
Csrc/main.py
D--ours
Attempts:
3 left
💡 Hint
Common Mistakes
Swapping 'ours' and 'theirs' options.
Using wrong file path.
5fill in blank
hard

Fill all three blanks to create a command that adds a conflicted file using your version and commits the merge.

Git
git checkout [1] -- [2] && git add [3] && git commit -m "Resolve conflict"
Drag options to blanks, or click blank then click option'
A--ours
Bconflict.txt
D--theirs
Attempts:
3 left
💡 Hint
Common Mistakes
Using '--theirs' instead of '--ours'.
Forgetting to add the file before commit.