We create a file /usr/local/etc/gitconfig
containing among other things:
[credential "https://github.com"]
helper = !path/to/binary git credentials
useHttpPath = true
With that configuration, we can clone private repositories successfully. The problem seems to be Xcode not picking that configuration for some reason.