]> gitweb.fluxo.info Git - rhatto/dotfiles/git.git/commitdiff
Adds merge-to alias
authorSilvio Rhatto <rhatto@riseup.net>
Sat, 17 Oct 2015 16:07:08 +0000 (13:07 -0300)
committerSilvio Rhatto <rhatto@riseup.net>
Sat, 17 Oct 2015 16:07:08 +0000 (13:07 -0300)
gitconfig.dot.link

index 2c332de82b54416d876840ed5b145dfc2b2ce7cc..14b48b6018116edcede2ec951fc02151f4380ff3 100644 (file)
@@ -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"