I found a lot of questions/answers about cloning a repository and checking out a given commit ID immediately. Trivial approach:
git clone <URL> working-copy
cd working-copy; git checkout <COMMIT-ID>
With branches you can just git clone -b <BRANCH> <URL>
With branches you can also make a shallow-clone which makes cloning much faster but then you can't checkout an arbitrary ID any more.
So my question is: is there a way to make a shallow clone of a given URL/commit ID without having to create a branch on the remote?
Are there differences for different types of remote repositories? (e.g. local file system, BitBucket, GitHub, GitLab, etc.)