It looks like performing a HEAD request on a private repo via CURL generates a 404 Not Found error. You can check for this error code as suggested above by @DarkBee.
curl -I https://github.com/EvansDaniel/LocalLocker
This command yields this output (this is a private repository of mine):
HTTP/1.1 404 Not Found
Server: GitHub.com
Date: Wed, 21 Mar 2018 09:57:32 GMT
Content-Type: text/plain; charset=utf-8
Status: 404 Not Found
X-Frame-Options: deny
X-XSS-Protection: 1; mode=block
X-Content-Type-Options: nosniff
Cache-Control: no-cache
Vary: X-PJAX
Set-Cookie: _gh_sess=eyJzZXNzaW9uX2lkIjoiNTE5YmE5NmI3ZjNhNDkzZTI3ODkyMmJjNTc2ZDU2YzYiLCJsYXN0X3dyaXRlIjoxNTIxNjI2MjUyMjc4fQ%3D%3D--896b8c3727dd9159a46262b6bd6fa2f405f2e674; path=/; secure; HttpOnly
X-Request-Id: 1fbd5a0c-2114-413b-b0f3-5b23bf1b6a43
X-Runtime: 0.016399
Strict-Transport-Security: max-age=31536000; includeSubdomains; preload
Referrer-Policy: origin-when-cross-origin, strict-origin-when-cross-origin
Expect-CT: max-age=2592000, report-uri="https://api.github.com/_private/browser/errors"
Content-Security-Policy: default-src 'none'; base-uri 'self'; connect-src 'self'; form-action 'self'; img-src data:; script-src 'self'; style-src 'unsafe-inline'
X-Runtime-rack: 0.021113
X-GitHub-Request-Id: 404D:3341:9F6864:11DFCD2:5AB22C8C
If you get the 404 error code, you can try to take the user's username and password, try shell_exec
with the git clone url command, and if that doesn't work out, tell the user that the repository doesn't exist i.e. the real reason for the 404 was that there is no repository at that url.