Skip to content

Instantly share code, notes, and snippets.

@jseifer
Created July 22, 2009 14:43
Show Gist options
  • Save jseifer/152028 to your computer and use it in GitHub Desktop.
Save jseifer/152028 to your computer and use it in GitHub Desktop.
# Find and replace in textmate to fix merge conflicts.
# As shown this takes the second capture group
#
# <<<<<<< HEAD:2983fjasd
# code1
# =======
# code2
# >>>>>>> master:2983rfja9sd
#
# As shown, this find and replace will take code 2.
#
# Replace HEAD, master, and capture groups as appropriate for your branches.
# Also, be sure to manually check on things. This is for pretty specific
# circumstances, but it works for me.
#
FIND: \<{7} HEAD[.|\s|\S]*?(={7}\n)([.\s\S]*?)>{7} master.*?\s
REPLACE: $1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment