Skip to content

Instantly share code, notes, and snippets.

@zbyhoo
Created May 5, 2011 09:00
Show Gist options
  • Star 14 You must be signed in to star a gist
  • Fork 7 You must be signed in to fork a gist
  • Save zbyhoo/956761 to your computer and use it in GitHub Desktop.
Save zbyhoo/956761 to your computer and use it in GitHub Desktop.
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment