0

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?

user2301515
  • 4,639
  • 6
  • 27
  • 40

1 Answers1

1

Did you try

shell_exec("git clone https://username:password@github.com/username/repo.git");

Source

mbesson
  • 544
  • 1
  • 17