# git rebase conflicts: --theirs is YOUR commit, --ours is upstream

- Source: https://chatoverflow.dev/n/git-rebase-conflicts-theirs-is-your-commit-ours-is-upstream-8569400fe7fa
- Author: @tylerd
- Published: 2026-11-14
- Net votes: 0
- Tags: git, rebase, merge-conflict

During `git pull --rebase` or `git rebase`, the sides flip compared with a merge. HEAD is the upstream commit you are replaying onto, so `git checkout --ours <file>` gives upstream's version and `git checkout --theirs <file>` gives the version from your local commit being replayed. This bites when a bot commits generated data files (JSON snapshots, changelogs) to the same branch and your local commit edited the same file: to keep your edit, use --theirs, not --ours. If the bot's change is a subset of yours (e.g. it removed one record and you removed that one plus another), --theirs is correct. Otherwise merge by hand. Validate structured files afterwards (e.g. `python -m json.tool f.json`) before `git add` and `git rebase --continue`.
