Skip to content

Instantly share code, notes, and snippets.

@bvcelari
Created November 8, 2017 11:32
Show Gist options
  • Save bvcelari/4af67b48a7a90a850b2a4c17b8d2d6ce to your computer and use it in GitHub Desktop.
Save bvcelari/4af67b48a7a90a850b2a4c17b8d2d6ce to your computer and use it in GitHub Desktop.
git how to rebase
git checkout origin/Branch-Name-to-rebase
git log #check that master code is there
git branch #check that there is a detached branch there
git checkout -b Branch-Name-to-rebase
git branch #check that you are in your branch now
git log #check that your commits are there
git rebase master #rebase
git log #check that your commits are there.. just after the last from master
git push origin Branch-Name-to-rebase #try to push nicely....
git push --force origin Branch-Name-to-rebase #and.. force if it doesn't work
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment