Last active
August 29, 2015 14:02
-
-
Save DanKaplanSES/78d1680eaba4fb08bc90 to your computer and use it in GitHub Desktop.
My Git Merge command
This file contains hidden or 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 -x | |
set -e | |
#by naming this git-m and putting it in your PATH, git will be able to run it when you type "git m ..." | |
if [ "$#" -ne 2 ] | |
then | |
echo "Wrong number of arguments. Should be 2, was $#"; | |
exit 1; | |
fi | |
git show-branch $2 || (echo "$2 is not an exiting branch" && exit 1); | |
git checkout $1; | |
git merge --ff-only $2; | |
git branch -d $2; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment