ours and theirs
During a merge, ours is the branch you are on and theirs is the branch being merged in.
In more detail
git checkout --ours file (or git restore --ours) takes your side of a conflicted file entirely, and --theirs takes the other side. In a rebase the roles swap, because you are replaying your commits onto the other branch.
Example
git checkout --ours shopping.txtRelated terms
- merge conflict — The situation where two branches changed the same lines differently since their merge base, so Git cannot combine them and asks you to choose.
- conflict markers — The lines Git writes into a conflicted file: <<<<<<< starts your side, ======= separates the two versions, and >>>>>>> ends their side.
Taught in
- Conventional Commits — Advanced Git Internals & Distributed Workflows
- Merging: Fast Forward Or A Merge Commit — Advanced Git Internals & Distributed Workflows
- Resolving A Conflict, Line By Line — Advanced Git Internals & Distributed Workflows