Skip to content

Instantly share code, notes, and snippets.

@oyeanuj
Last active October 18, 2017 17:56
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 oyeanuj/174d77651024f7ca960740706b5f6f98 to your computer and use it in GitHub Desktop.
Save oyeanuj/174d77651024f7ca960740706b5f6f98 to your computer and use it in GitHub Desktop.
Rebasing instructions
# For example I will create a branch off of “next”:
git checkout next
git checkout -b feature/my-new-feature
# Then I have done some work on my new branch, whilst updates
# happened to “next”. Before I do a rebase of my feature branch
# I do a fetch and check my branches:
git fetch
git branch -vv
# I want to see ifmy feature branch is up to date with the remote
# copy of my feature branch (if it had previously been pushed to remote)
# When I am happy I that I have all the changes for my feature
# branch from the remote I then rebase my branch targetting the
# remote verison of the “next” branch I want to rebase against:
git rebase origin/next
# ...do the whole git rebase --continue melarchy..
# And when all good do a forced push:
git push -f
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment