It happens if your Mac has no certificate for the particular website, in this case, for GITHUB.
I added the following to override the SSL verification.Others suggested to add certificate directly to the Mac system, which needs more time: I gave up.
export GIT_SSL_NO_VERIFY=true