Remix.run Logo
em-bee 2 hours ago

a better (more confusing) example:

i have a branch and i want to merge that branch into main.

is ours the branch and main theirs? or is ours main, and the branch theirs?

IgorPartola 2 hours ago | parent [-]

I always checkout the branch I am merging something into. I was vaguely aware I could have main checked out but merge foo into bar but have never once done that.

Sharlin 2 hours ago | parent [-]

  git checkout mybranch
  git rebase main
A conflict happens. Now "ours" is main and "theirs" is mybranch, even though from your perspective you're still on mybranch. Git isn't, however.
IgorPartola an hour ago | parent [-]

Ah that’s fair. This is why I would do a `git merge main` instead of a rebase here.

ljm an hour ago | parent [-]

I have met more than one person who would doggedly tolerate rebase, not even using rerere, instead of doing a simple ‘git merge --no-ff’ to one-shot it, not understanding that rebase touches every commit in the diff between main and not simply the latest change on HEAD.

Not a problem if you are a purist on linear history.