0
0
Gitdevops~5 mins

Ours vs theirs in conflicts in Git - Quick Revision & Key Differences

Choose your learning style9 modes available
Recall & Review
beginner
What does 'ours' mean in a Git conflict?
'Ours' refers to the version of the file from the current branch you are on when a conflict happens.
Click to reveal answer
beginner
What does 'theirs' mean in a Git conflict?
'Theirs' means the version of the file from the branch you are trying to merge into your current branch.
Click to reveal answer
intermediate
How do you choose 'ours' version to resolve a conflict using Git command line?
You can run: git checkout --ours <file> to keep your current branch's version of the file.
Click to reveal answer
intermediate
How do you choose 'theirs' version to resolve a conflict using Git command line?
You can run: git checkout --theirs <file> to keep the incoming branch's version of the file.
Click to reveal answer
beginner
Why is it important to understand 'ours' vs 'theirs' in Git conflicts?
Because it helps you decide which changes to keep when two versions of a file clash, avoiding mistakes and lost work.
Click to reveal answer
In a Git merge conflict, what does 'ours' refer to?
AThe current branch's version
BThe incoming branch's version
CA backup copy
DThe remote repository
Which command keeps the 'theirs' version of a file during conflict resolution?
Agit checkout --theirs <file>
Bgit reset <file>
Cgit checkout --ours <file>
Dgit merge --abort
If you want to keep your current branch's changes during a conflict, which option do you use?
Anone
Btheirs
Cboth
Dours
What happens if you do not resolve a Git conflict?
AGit automatically chooses 'theirs'
BYou cannot complete the merge
CGit automatically chooses 'ours'
DGit deletes the conflicting files
Which of these is NOT a way to resolve conflicts in Git?
AManually editing the file
BUsing git checkout --theirs
CRunning git push --force
DUsing git checkout --ours
Explain the difference between 'ours' and 'theirs' in Git conflicts.
Think about which branch you are on and which branch you are merging.
You got /3 concepts.
    Describe how to resolve a conflict by choosing the 'theirs' version using Git commands.
    Remember the steps to tell Git which version to keep and mark conflict resolved.
    You got /3 concepts.