C
C#13mo ago
AdiZ

✅ 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.
No description
No description
16 Replies
AdiZ
AdiZOP13mo ago
This is CipherDecoderApp.unity
AdiZ
AdiZOP13mo ago
If someone could help me figure this out that would be great.
Jimmacle
Jimmacle13mo ago
merge conflicts look like this
<<<<<<< HEAD
=======
- {fileID: 2048073632}
>>>>>>> parent of 9f3889c (CRASHING - Changed TMP Input Field Objects)
<<<<<<< HEAD
=======
- {fileID: 2048073632}
>>>>>>> parent of 9f3889c (CRASHING - Changed TMP Input Field Objects)
AdiZ
AdiZOP13mo ago
Okay I've found it.
Jimmacle
Jimmacle13mo ago
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
AdiZ
AdiZOP13mo ago
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.
No description
Jimmacle
Jimmacle13mo ago
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 one
AdiZ
AdiZOP13mo ago
But does that mean that nothing is being changed? How can a commit even have nothing in it?
Jimmacle
Jimmacle13mo ago
that's not a commit, that's a merge conflict
AdiZ
AdiZOP13mo ago
Ohh right
Jimmacle
Jimmacle13mo ago
so this one is easy, assuming you want that fileID line just replace that whole section with
- {fileID: 2048073632}
- {fileID: 2048073632}
AdiZ
AdiZOP13mo ago
So replace these 4 lines with that fileID?
No description
mtreit
mtreit13mo ago
VS Code has a nice UI for helping with merge conflicts.
AdiZ
AdiZOP13mo ago
Where can I find that? This is all I could find
mtreit
mtreit13mo ago
Like you should see something that says "Accept Incoming Change" or "Accept Current Change" that you can click above the conflict.
AdiZ
AdiZOP13mo ago
Yep I see that Oh right of course that means I don't have to do anything manually Thank you both!
Want results from more Discord servers?
Add your server