From: Silvio Rhatto Date: Sat, 17 Oct 2015 16:07:08 +0000 (-0300) Subject: Adds merge-to alias X-Git-Url: https://gitweb.fluxo.info/?a=commitdiff_plain;h=e157ca4ed79288c41aa6765347558ba1b292a371;p=rhatto%2Fdotfiles%2Fgit.git Adds merge-to alias --- diff --git a/gitconfig.dot.link b/gitconfig.dot.link index 2c332de..14b48b6 100644 --- a/gitconfig.dot.link +++ b/gitconfig.dot.link @@ -12,3 +12,8 @@ [hooks] global = ~/apps/scripts/misc/git-hooks/contrib/ ~/.git_hooks + +[alias] + # Thanks https://stackoverflow.com/questions/3672073/git-merge-to-another-branch + #merge-to = "!f() { git checkout $1 && git merge $2 && git checkout -; }; f" + merge-to = "!f() { export tmp_branch=`git branch | grep '* ' | tr -d '* '`; git checkout $1 && git merge $tmp_branch && git checkout $tmp_branch; unset $tmp_branch; }; f"