Skip to content

Instantly share code, notes, and snippets.

@nitinsatish
Last active May 20, 2021 10:17
Show Gist options
  • Save nitinsatish/17790c5dfcab63d18e691af9ee5167c0 to your computer and use it in GitHub Desktop.
Save nitinsatish/17790c5dfcab63d18e691af9ee5167c0 to your computer and use it in GitHub Desktop.
[Git branch issues] #git

Make sure you've pulled the new upstream branch into your local repo:

  1. First, ensure your working tree is clean (commit/stash/revert any changes) Then,

git fetch upstream

to retrieve the new upstream branch 2. Create and switch to a local version of the new upstream branch (newbranch):

git checkout -b newbranch upstream/newbranch

  1. 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)

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