Skip to content

Instantly share code, notes, and snippets.

@frigginglorious
Created February 7, 2017 22:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save frigginglorious/e3111c6196acaa0f18dee0e7314264f9 to your computer and use it in GitHub Desktop.
Save frigginglorious/e3111c6196acaa0f18dee0e7314264f9 to your computer and use it in GitHub Desktop.
F**k your code: Merge Conflict Resolution.
Here is regex that you can use in your IDE (Atom or Sublime Text) to find and/or replace merge conflict text.
This overwrites all code that conflicts with your changes.
*KNOWN BUG*: If the code between the "=======" and the ">>>>>>" has blank lines in it, this won't work.
(<<<<<<< HEAD\n)|(=======\n)((.+\n)+)(>>>>>>)+.*\n
View an example at http://regexr.com/3f86m
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment