After cloning a remote repository it does not show any remote branch by -a option. What could be the problem? How to debug it? In this snippet two of the remote branches are
After doing a shallow clone, to be able to checkout other branches from remote,
Run (thanks @jthill):
git remote set-branches origin '*'
After that, do a git fetch -v
Finally git checkout the-branch-i-ve-been-looking-for
Step 1 can also be done manually by editing .git/config.
For instance, change the folloing line from:
fetch = +refs/heads/master:refs/remotes/origin/master
to (replace master with *):
fetch = +refs/heads/*:refs/remotes/origin/*