I cloned a Git repository, which contains about five branches. However, when I do git branch I only see one of them:
git branch
$ git branch * master
To avoid the error message 'fatal: A branch named 'origin/master' already exists.', you may try my solution:
git branch -r | grep -v '\->' | grep -v `git branch | awk '/\*/ { print $2; }'`| while read remote; do git branch --track "${remote#origin/}" "$remote"; done