I used git remote set-branches --add origin develop
in my case after a shallow clone only fetched me master and I couldn't checkout develop. Might not be the best solution though as it's only adding this one branch. Definitely the shallow clone was the culprit.