Skip to content

Instantly share code, notes, and snippets.

@jducoeur
Created February 6, 2019 14:08
Show Gist options
  • Save jducoeur/39b08f87b840644029894ad1e2357736 to your computer and use it in GitHub Desktop.
Save jducoeur/39b08f87b840644029894ad1e2357736 to your computer and use it in GitHub Desktop.

Rebase to Master: the formula appears to be:

Make sure that we’ve on the PR branch:

git branch -av

If not already done, make sure the branch is compiling and testing cleanly, and that everything is checked in.

Check whether we have an upstream set:

git remote -v

Add the upstream if there isn’t one:

git remote add upstream <clone URL of the official master repo>

Check the remotes again, to make sure the upstream looks right.

Fetch the upstream, to get the current master:

git fetch upstream

Do the actual rebase operation:

git rebase upstream/master

Clean, compile, test, and fix stuff if needed.

Force-push the new code to my own repo:

git push -f origin <branch name>

Check that it builds and tests properly in the PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment