Skip to content

Instantly share code, notes, and snippets.

@tomykaira
Created July 14, 2012 12:47
Show Gist options
  • Save tomykaira/3111090 to your computer and use it in GitHub Desktop.
Save tomykaira/3111090 to your computer and use it in GitHub Desktop.
git-mergeto does non-fast-forward merge from the current branch onto the specified branch.
#!/bin/sh -e
BRANCH=`git symbolic-ref HEAD 2>/dev/null | cut -d/ -f3`
if [ x$1 = 'x' ]; then
TO='master'
else
TO=$1
fi
git checkout $TO
git merge $BRANCH --no-ff
git branch -d $BRANCH
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment