Resolving Merge Conflicts
Sometimes, especially if you work on your project from multiple computers, you will experience a merge conflict when you attempt to sync with your remote.
Merge conflicts are a totally normal part of source control management, and resolving them is quite simple.
Whether you are resolving the merge conflict on the GitHub desktop app or on the Remote (using the website), the process is quite simple.
Notice, there in an error in the GitHub Version,
java.io.Scannerdoes not exist. Additionally, we provided an output to the user on the Netbeans version that is missing from the GitHub version.
To resolve the conflict, examine an example conflict
<<<<<<< HEAD import java.util.Scanner; ======= import java.io.Scanner; >>>>>>> origin/master
- The portion above the equals signs is the version currently on the desktop, the version below is currently located on the remote.
- The first question we should ask is "Why did I use two different imports? Which one is correct?"
java.util.Scanner;is the correct import statement, so we should delete the incorrect statement.
<<<<<<< HEAD import java.util.Scanner; ======= >>>>>>> origin/master
- Now, in order to indicate to git that the conflict is resolved by removing the labels.