Suppose I have a remote git repo which is extremely big (e.g. > 10 GiB) and the network connection is unstable which means any attempt of fetching the whole repo is deemed to fail (i.e., not possible to execute anything like git fetch --all or git fetch --unshallow).
I however managed to get a shallow clone by issuing git clone --depth 1. However, this shallow clone does not have any branches other than master. Neither git checkout <branch> nor git checkout -b <branch> --track <origin/branch> works. No branch is showing for git branch -r either.
It is possible to run git fetch --depth 1 origin <branch>, but after that the desired branch does not show in git branch or git branch -r either, and any attempt to checkout that branch still fails.
How can I checkout a remote branch in this situation?
Remarks,
git clone -b <branch> --depth 1 does work, but even a shallow clone takes hours to complete (if it completes at all), so I would like to reuse as many local objects as possible.
