tj.git-extras/bin/git-graft
Leila Muhtasib 3d0b4feb80 graft: Require destination branch. Fix #23
This is to avoid the old behaviour of automatically
merging into master.
2015-07-25 04:16:09 +02:00

12 lines
240 B
Bash
Executable file

#!/usr/bin/env bash
src=$1
dst=$2
test -z $src && echo "source branch required." 1>&2 && exit 1
test -z $dst && echo "destination branch required." 1>&2 && exit 1
git checkout $dst \
&& git merge --no-ff $src \
&& git branch -d $src