Where are my git branches?
I was working on my work computer the other day and set up a new branch in github. I made a local and remote branch.
Today I am working on my laptop at home and I don’t see my branch that I made when I run “git branch”.
How do I get access to this branch?
3 Solutions collect form web for “Where are my git branches?”
assuming you have this branch in your local repository, you can use
git checkout <branchname> to checkout a branch
If this branch is on the github repository but not in your local repository, you may want to
git remote update before
git checkout <branchname> and
git pull to fetch changes
What seems to have happened here, is that your local cache of the remote state is outdated. Before you can access these new branches you will need to refresh your local copy of the repository’s state.
You can do this with:
git remote update(see the earlier answer by Michael Ira Krufky)
git fetch [remotename]
Additionally when you run
git pull this automatically includes a
git fetch so that would also update your local copy
git branch -a to show all the branches.