Tags: #git #rebase #merge
https://nitaym.github.io/ourstheirs/
The summary is: git checkout has the following flags whose assigned values can be very confusing.
--ours == main--theirs == the feature branch.The flag values don’t change between git merge and git rebase (e.g. †) so it’s safe to remember the above values.
†
git switch main && git merge featurevsgit switch feature && git rebase main.
I typically rebase feature over my main branch:
git switch feature
git pull --rebase origin main
git checkout --theirs <file>
git add <file>
git rebase --continue