What do --ours and --theirs mean when resolving a conflict?
In a merge, ours is the branch you are on and theirs is the branch being merged in. git checkout --ours file or --theirs file takes that whole version of the file. In a rebase the meaning is reversed.
Explain it simply
When settling a dispute you sometimes decide 'just take my version for this file'. The flags do that for a whole file.
During git merge feature on main, ours is main and theirs is feature. During git rebase main on feature, Git is replaying your commits onto main's history, so 'ours' is main (the base being built) and 'theirs' is your own commit. Because it surprises everyone, check with git diff after choosing. For a mix, edit the file by hand. The merge strategy option -X ours is different: it resolves only the conflicting hunks in your favour.
Example
git checkout --theirs pricing.json # take incoming version
git add pricing.json
git merge -X ours feature # prefer my side on conflictsWhat to say in the interview
"In a merge, ours is the current branch and theirs the incoming one. In a rebase it is swapped. I can take a whole file with checkout --ours or --theirs, but I review the result, and I know -X ours only decides conflicting hunks."