0

Why does git occasionally write markup to my source code such as the following?

<<<<<<< HEAD
  <component name="JavaScriptSettings">
    <option name="languageLevel" value="ES6" />
  </component>
=======
>>>>>>> 02d2be40f4d48e8bcddbd819c19e3c01c4e690c4

where everything between HEAD and ======= is source code and the rest is markup git seems to have been using for tracking and merging changes. In my case, these appeared after attempting to remove a folder from the history using filter-branch:

Remove folder and its contents from git/GitHub's history

Is this possibly something IntelliJ is injecting?

Adrian W
  • 4,563
  • 11
  • 38
  • 52
andrew
  • 3,929
  • 1
  • 25
  • 38
  • 1
    it means you have an unresolved conflict during a `git pull` or (more likely) a `git merge` command. See here for help on how to resolve the conflicts: https://www.jetbrains.com/help/idea/resolving-conflicts.html – blurfus Sep 05 '18 at 22:26
  • this is definitely a duplicate, but I was striking out searching the `<<<<<<< HEAD` string. – andrew Sep 06 '18 at 06:11

1 Answers1

4

These markers mean that there was a conflict in your code (maybe after pulling), and you probably just marked the file as resolved instead of actually resolving the conflict.

IntelliJ IDEA has nothing to do with this, though it provides a nice instrument of resolving conflicts in the Version Control panel.

Mikhail Burshteyn
  • 4,762
  • 14
  • 27