2015-05-26

Somebody committed a conflicted file to git. Oh noes!!!

Now I got a file full of diff "hints" that no patch or git mergetool will understand.

Option 1: have the person fix it on their side.

Option 2 (for the crazy like me): use REGEX!!!

On an editor supporting REGEX find/replace:
  • Look for (match): <<<<<<< .*[\n]([\s\S]*?)=======[\n]([\s\S]*?)>>>>>>> .*[\n]
  • To keep the first, replace by: $1
  • To keep the second, replace by: $2
Other alternatives are welcome!

No comments:

Post a Comment