Created
August 18, 2010 01:08
-
-
Save witkamp/532915 to your computer and use it in GitHub Desktop.
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/bash | |
# This is wrapper for Beyond Compare 3 to be able to do a 3 way and 2 way merge | |
# When using git though cygwin | |
# GIT does will pass in a base file name that does not exist when merging two | |
# files with not common parent. This script detects this and switches to a | |
# 2-Way merge. | |
# -Theodore Witkamp theodore.witkamp@gmail.com | |
## | |
bc3="`cygpath -u "c:\\Program Files\\Beyond Compare 3\\BComp"`" | |
echo $bc3 | |
echo "LOCAL $LOCAL" | |
echo "REMOTE $REMOTE" | |
echo "BASE $BASE" | |
echo "MERGED $MERGED" | |
## Create local var for IF statement | |
base = $BASE | |
## GIT will pass in a BASE file name although it only will exist if the file | |
## has a common base file between the two files | |
if [ -e $base]; | |
then | |
echo "3-Way Merge" | |
exec "$bc3" "$LOCAL" "$REMOTE" "$BASE" "/mergeoutput=$MERGED" | |
else | |
## The BASE File does not exist just do a 2-Way merge | |
echo "2-Way Merge" | |
exec "$bc3" "$LOCAL" "$REMOTE" "/mergeoutput=$MERGED" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment