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?

1 Answer 1

1

Did you try

shell_exec("git clone https://username:[email protected]/username/repo.git");

Source

Sign up to request clarification or add additional context in comments.

1 Comment

It works only in own localhost, but not in a server.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.