After doing a shallow clone,
to be able to checkout other branches from remote,
-
Run (thanks @jthill) doc about set-branches:
git remote set-branches origin '*' -
After that, do a
git fetch -v --depth=1 -
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/*