Created
August 31, 2013 02:55
-
-
Save danielglh/6395969 to your computer and use it in GitHub Desktop.
Simulate merge -s theirs since git has removed this strategy
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 | |
merge_branch=$1 | |
test -z $merge_branch && echo "branch required." 1>&2 && exit 1 | |
current_branch=$(git branch | sed -n -e 's/^\* \(.*\)/\1/p') | |
git checkout $merge_branch | |
git checkout -b tmp | |
git merge -s ours $current_branch | |
git checkout $current_branch | |
git merge tmp | |
git branch -D tmp |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment