Here's possibility for cloning git private repository:
$ git clone https://github.com/username/repo.git
Username: your_username #the username
Password: your_token #the string that can be found by generating here https://github.com/settings/tokens
How to use in php
shell_exec("git clone https://github.com/username/repo.git");
with seting username and password?