Skip to content

Instantly share code, notes, and snippets.

Last active August 29, 2015 14:02
What would you like to do?
My Git Merge command
#!/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 ]
echo "Wrong number of arguments. Should be 2, was $#";
exit 1;
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