Skip to content

Instantly share code, notes, and snippets.

@tusharmath
Created July 25, 2017 05:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tusharmath/97c392a214d1abb4dfe6fd5536813332 to your computer and use it in GitHub Desktop.
Save tusharmath/97c392a214d1abb4dfe6fd5536813332 to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
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