I cloned a Git repository, which contains about five branches. However, when I do git branch I only see one of them:
$ git branch
* master
If you are here seeking a solution to get all branches and then migrate everything to another Git server, I put together the below process. If you just want to get all the branches updated locally, stop at the first empty line.
git clone
git branch -r | awk -F'origin/' '!/HEAD|master/{print $2 " " $1"origin/"$2}' | xargs -L 1 git branch -f --track
git fetch --all --prune --tags
git pull --all
git remote set-url origin
git pull
git push --all
git push --tags