From f3f2f6e28583f1ac073eff4863ff1327cf76ea3c Mon Sep 17 00:00:00 2001 From: Vinicius Fernandes Date: Tue, 26 Jan 2016 18:58:08 -0200 Subject: [PATCH] Adds git alias to rebase current branch with master --- plugins/git/git.plugin.zsh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/plugins/git/git.plugin.zsh b/plugins/git/git.plugin.zsh index b851fb97..0a1969bb 100644 --- a/plugins/git/git.plugin.zsh +++ b/plugins/git/git.plugin.zsh @@ -33,6 +33,13 @@ function work_in_progress() { fi } +# Rebase current branch with the most updated master +# +function rebase_with_master() { + local b=$(git_current_branch) + git checkout master && git pull --rebase && git checkout $b && git rebase master +} + # # Aliases # (sorted alphabetically) @@ -174,6 +181,7 @@ alias gpv='git push -v' alias gr='git remote' alias gra='git remote add' alias grb='git rebase' +alias grbb='rebase_with_master' alias grba='git rebase --abort' alias grbc='git rebase --continue' alias grbi='git rebase -i'