Skip to content

Instantly share code, notes, and snippets.

@rajatvig
Created October 14, 2015 18:52
Show Gist options
  • Save rajatvig/776fc9c34223be84fa80 to your computer and use it in GitHub Desktop.
Save rajatvig/776fc9c34223be84fa80 to your computer and use it in GitHub Desktop.
Rebase the Master when working with Gerrit
function git_rebase_from_master
function _git_branch_name
echo (git symbolic-ref HEAD ^/dev/null | sed -e 's|^refs/heads/||')
end
set -l git_branch (_git_branch_name)
git checkout master
git pull --rebase origin master
git fetch --all
git checkout $git_branch
git rebase master
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment