Instantly share code, notes, and snippets.

Embed
What would you like to do?
Solving pbxproj files git merge conflicts when two users add files at the same time.
#!/bin/sh
projectfile=`find -d . -name 'project.pbxproj'`
projectdir=`echo *.xcodeproj`
projectfile="${projectdir}/project.pbxproj"
tempfile="${projectdir}/project.pbxproj.out"
savefile="${projectdir}/project.pbxproj.mergesave"
cat $projectfile | grep -v "<<<<<<< HEAD" | grep -v "=======" | grep -v "^>>>>>>> " > $tempfile
cp $projectfile $savefile
mv $tempfile $projectfile
@berikv

This comment has been minimized.

Copy link

berikv commented Feb 13, 2012

vim project.pbxproj
:g/(>>>>>|=====|<<<<<).*/d

@truebit

This comment has been minimized.

Copy link

truebit commented Aug 11, 2014

you should escape (,|,)
so it should be command:

:g/\(>>>>>\|=====\|<<<<<\).*/d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment