Skip to content

Instantly share code, notes, and snippets.

@dstnbrkr
Created January 13, 2012 21:15
Show Gist options
  • Save dstnbrkr/1608740 to your computer and use it in GitHub Desktop.
Save dstnbrkr/1608740 to your computer and use it in GitHub Desktop.
git-merge-combine
#!/bin/sh
# Combines two versions of a file by removing all conflict markers
# Usage: git-merge-combine MyProject.xcodeproj/project.pbxproj
FILE=$1
TMPFILE=$1.tmp
sed -e 's/<<<<<<< HEAD//; s/=======//g; s/>>>>>>> .*$//' $FILE > $TMPFILE
if [ $? -ne 0 ]; then
exit;
fi
mv $TMPFILE $FILE
git add $FILE
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment