-
Make sure you’ve pulled the new upstream branch into your local repo:
- First, ensure your working tree is clean (commit/stash/revert any changes)
- Then,
git fetch upstreamto retrieve the new upstream branch
-
Create and switch to a local version of the new upstream branch (
newbranch):git checkout -b newbranch upstream/newbranch
-
When you’re ready to push the new branch to origin:
git push -u origin newbranch
The -u switch sets up tracking to the specified remote (in this example, origin)