2

The git docs have a section which talks about merge conflicts which describes a set of markers added to a file during a merge conflict:

Git adds standard conflict-resolution markers to the files that have conflicts...

They give you the meanings of <<<<<<<, ======= and >>>>>>>, but is there an authoratitive place where all the possible markers are defined?

I'm seeing merge conflicts like this:

<<<<<<< HEAD
... some code
||||||| parent of cebb63a (my first commit)
... some other code
=======
... a third set of code
>>>>>>> cebb63a (my first commit)

The documentation I linked to doesn't mention these pipe symbols (|||||||). What are they and where can I find authoratitive documentation on what they mean?


Update

There's an exhaustive description of the whole issue of conflict-resolution markers here but this question is a bit more focused on ||||||| which was unfamiliar to me when I first saw it.

LondonRob
  • 73,083
  • 37
  • 144
  • 201
  • Does this answer your question? [What is a simple explanation of these Git merge markers?](https://stackoverflow.com/questions/56150904/what-is-a-simple-explanation-of-these-git-merge-markers) – CodeCaster May 12 '23 at 13:29
  • @CodeCaster it's certainly a great explanation. But it is authoratitive documentation? I usually look for something from `git-scm.com` when looking to understand what git is doing. Is this a dupe? I don't know. I'll let someone better informed in StackOverflow lore/culture than me decide. – LondonRob May 12 '23 at 13:45
  • 2
    Well the answer is by Torek, which is like a GPT engine tuned to git-scm.com. But yeah there's https://git-scm.com/docs/merge-config#Documentation/merge-config.txt-mergeconflictStyle. – CodeCaster May 12 '23 at 14:04
  • Apparently Subversion has the same thing. And CVS. (Not that they are ancestors but they came before Git.) So if there isn’t any authoritative Git document about it then I suppose it’s because it was already established practice. – Guildenstern May 12 '23 at 14:07
  • Your `|||||` comes from the `diff3` style of conflict markers. Meanwhile `====` are from the `merge` style, which was (and is?) the default. – Guildenstern May 12 '23 at 14:17
  • @CodeCaster The docs you link to in your comment is the answer to this question! Post it as an answer and I'll upvote. I don't think this is quite a duplicate of the other question. – LondonRob May 12 '23 at 15:10

0 Answers0