I have a master and a development branch, both pushed to GitHub. I\'ve cloned, pulled, and fetched, but I re
Git usually (when not specified) fetches all branches and/or tags (refs, see: git ls-refs) from one or more other repositories along with the objects necessary to complete their histories. In other words it fetches the objects which are reachable by the objects that are already downloaded. See: What does git fetch really do?
Sometimes you may have branches/tags which aren't directly connected to the current one, so git pull --all/git fetch --all won't help in that case, but you can list them by:
git ls-remote -h -t origin
and fetch them manually by knowing the ref names.
So to fetch them all, try:
git fetch origin --depth=10000 $(git ls-remote -h -t origin)
The --depth=10000 parameter may help if you've shallowed repository.
Then check all your branches again:
git branch -avv
If above won't help, you need to add missing branches manually to the tracked list (as they got lost somehow):
$ git remote -v show origin
...
Remote branches:
master tracked
by git remote set-branches like:
git remote set-branches --add origin missing_branch
so it may appear under remotes/origin after fetch:
$ git remote -v show origin
...
Remote branches:
missing_branch new (next fetch will store in remotes/origin)
$ git fetch
From github.com:Foo/Bar
* [new branch] missing_branch -> origin/missing_branch
If you still cannot get anything other than the master branch, check the followings:
git remote -v), e.g.
git config branch.master.remote is origin.origin points to the right URL via: git remote show origin (see this post).