Forked from zbyhoo/solve_pbxproj_merge_conflict.sh
Created
February 10, 2012 15:47
-
-
Save xslim/1790379 to your computer and use it in GitHub Desktop.
Solving pbxproj files git merge conflicts when two users add files at the same time.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
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
vim project.pbxproj
:g/(>>>>>|=====|<<<<<).*/d