Like our commentator said, this is due to a git conflict, lets look closer:
<<<<<<< HEAD
public static String getNamesByIndex(int index) {
return playerNameList.get(index);
}
=======
>>>>>>> 0bfheisi8d88wdjksiijfils8879s
the =======
is the separator. Everything above that is what is in your current directory, and everything below it is in the remote, commit 0bfheisi
.
This might be an automatically resolvable conflict. If you're the only one working on the project, and only are using it on a single computer, then this shouldn't be showing up if you're using git correctly. If you're working on the project with other colleagues then if you both make a change to the same area (and you didn't pull
first) then this will happen because git needs you to choose which version is the correct version.
However, you shouldn't ever have to
go in and manually delete the erroneous text afterwards.
What you should be doing is the following:
- Stage, and commit local changes.
- Pull remote branch (can cause an automatic merge)
- If there is a conflict, git will tell you at this point. If so, use
git mergetool
to open your specified conflict resolution tool. I use Beyond Compare 3 as it is an excellent gui tool for windows, but many options exist.
- Now, once conflicts are resolved (not manually, but with your mergetool) push your changes to your remote branch.
I mentioned this above but will stress it again here, conflicts don't need to happen often, even if you're working with multiple people and are changing the same areas of code - as long as you frequently pull changes before starting a new change yourself, and committing and pushing often.
Happy gitting.