-
Notifications
You must be signed in to change notification settings - Fork 2
Git Checkout A Remote Branch
Depending on how many remotes are present for your local repo, follow the appropriate flow.
If your local repo is having just one remote for example just origin
:
git remote -v
origin https://github.com/my_username/AwesomeRepo.git (fetch)
origin https://github.com/my_username/AwesomeRepo.git (push)
Then you can simply do:
git fetch
git checkout some_branch_name
If your local repo is having multiple remotes:
git remote -v
origin https://github.com/raisedadead/wiki.git (fetch)
origin https://github.com/raisedadead/wiki.git (push)
upstream https://github.com/FreeCodeCamp/wiki.git (fetch)
upstream https://github.com/FreeCodeCamp/wiki.git (push)
Then you have to specify a remote as well:
git fetch
git checkout -b some_branch_name <remote>/some_branch_name
where <remote>
in this example is either upstream
or origin
.
Learn to code and help nonprofits. Join our open source community in 15 seconds at http://freecodecamp.com
Follow our Medium blog
Follow Quincy on Quora
Follow us on Twitter
Like us on Facebook
And be sure to click the "Star" button in the upper right of this page.
New to Free Code Camp?
JS Concepts
JS Language Reference
- arguments
- Array.prototype.filter
- Array.prototype.indexOf
- Array.prototype.map
- Array.prototype.pop
- Array.prototype.push
- Array.prototype.shift
- Array.prototype.slice
- Array.prototype.some
- Array.prototype.toString
- Boolean
- for loop
- for..in loop
- for..of loop
- String.prototype.split
- String.prototype.toLowerCase
- String.prototype.toUpperCase
- undefined
Other Links