Skip to content

Instantly share code, notes, and snippets.

@ivikash
Created July 25, 2017 06:31
Show Gist options
  • Select an option

  • Save ivikash/cc21d11f68e92bc0692b74deaab0568d to your computer and use it in GitHub Desktop.

Select an option

Save ivikash/cc21d11f68e92bc0692b74deaab0568d to your computer and use it in GitHub Desktop.
git_rebase_onto_master () {
git fetch origin
commitID=`git log origin/master..HEAD --oneline --pretty=format:"%h" | tail -1`
git rebase --onto origin/master $commitID~1 -i --preserve-merges --autosquash
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment