Skip to content

Instantly share code, notes, and snippets.

@danielglh
Created August 31, 2013 02:55
Show Gist options
  • Save danielglh/6395969 to your computer and use it in GitHub Desktop.
Save danielglh/6395969 to your computer and use it in GitHub Desktop.
Simulate merge -s theirs since git has removed this strategy
#!/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