Reputation: 12343
OK, I made a big mistake. I pushed a feature branch, and it was merged to main via PR. Then I made additional fixes to the feature branch, and committed that and tried to make a PR. It said there were merge conflicts. Im conflicting with myself.
So I did the following:
My file now has an incomprehensible set of === and >>> listed. I cant easily see which bits I should delete, and which bits I should keep.
What I really want to do is just keep the latest version on my branch, as its the newer version of whats in main.
I tried to do this via eclipse merge tool, but this tool only offers to copy from right (server) to left (my version), and of course I want the other way round. The merge tool has no option to take the left version.
So I have two options:
Presumably there are other options (ideally not dangerous or arcane?)
Upvotes: 0
Views: 499
Reputation: 21938
How to handle it via CLI :
git checkout --ours -- path/to/file
where
--ours
asks for the receiving branch's version of the file (doc)
--
means "end of options, everything past this is pathspecs" (doc)
Then just add your file and commit the merge when you're done with other conflicts.
Upvotes: 1