deleted 2 characters in body
Source Link
prusswan
  • 6.5k
  • 3
  • 37
  • 57

If the branch is on something other than the origin remote I like to do the following:

$ git fetch
$ git checkout -b upstreamsecond/next upstream/next

This will checkout the next branch on the upstream remote in to a local branch called second/next. Which means if you already have a local branch named next it will not conflict.

$ git branch -a
* second/next
  remotes/origin/next
  remotes/upstream/next

If the branch is on something other than the origin remote I like to do the following:

$ git fetch
$ git checkout -b upstream/next upstream/next

This will checkout the next branch on the upstream remote in to a local branch called second/next. Which means if you already have a local branch named next it will not conflict.

$ git branch -a
* second/next
  remotes/origin/next
  remotes/upstream/next

If the branch is on something other than the origin remote I like to do the following:

$ git fetch
$ git checkout -b second/next upstream/next

This will checkout the next branch on the upstream remote in to a local branch called second/next. Which means if you already have a local branch named next it will not conflict.

$ git branch -a
* second/next
  remotes/origin/next
  remotes/upstream/next
Source Link
Kris
  • 17.4k
  • 6
  • 84
  • 102

If the branch is on something other than the origin remote I like to do the following:

$ git fetch
$ git checkout -b upstream/next upstream/next

This will checkout the next branch on the upstream remote in to a local branch called second/next. Which means if you already have a local branch named next it will not conflict.

$ git branch -a
* second/next
  remotes/origin/next
  remotes/upstream/next