✅ How to Fix Merge Conflicts? Beginner - Confused
I have no idea what I've done. I tried to revert a commit through GitHub Desktop and now this has happened.
16 Replies
This is
CipherDecoderApp.unity
If someone could help me figure this out that would be great.
merge conflicts look like this
Okay I've found it.
git is saying that it doesn't know how to combine the changes so it just includes both versions and tells you to fix it yourself
How kind of it 😂 .When I click on
Compare Changes
it just shows me this and I can't make any sense of this without visual representation.the part above the
=======
line is the version at your HEAD commit and the part below is the version from the specified commit
so you have to pick out which bits of code you want, then replace the whole conflict section with that and commit it like you normally would
it just so happens that there's nothing in the HEAD version of this oneBut does that mean that nothing is being changed?
How can a commit even have nothing in it?
that's not a commit, that's a merge conflict
Ohh right
so this one is easy, assuming you want that fileID line just replace that whole section with
So replace these 4 lines with that fileID?
VS Code has a nice UI for helping with merge conflicts.
Where can I find that? This is all I could find
Like you should see something that says "Accept Incoming Change" or "Accept Current Change" that you can click above the conflict.
Yep I see that
Oh right of course that means I don't have to do anything manually
Thank you both!