A member of my team created a branch on GitHub.
On my computer i can
- only see the master branch
- and the branch that I myself had created.
How do I update my local git to show the other branches on the GitHub repository?
A member of my team created a branch on GitHub.
On my computer i can
How do I update my local git to show the other branches on the GitHub repository?
First, you'd probably need to fetch
to get fresh references from your remote repo.
Then, use git branch -r
to have the full list of remote branches.
The listed references are only images of where these remote branches are pointing to at the moment you fetched, but be aware that :
You won't be able to check them out as if they were local branches.
They might change at any moment on the remote end, you local repo won't be notified of it. fetch
each time you want to check for new branches/tags.
To check a branch out locally to work on it, just git checkout <branchname>
without the <remotename>/
and git will automatically set the remote branch as the pull/push default destination for your local copy.