M
M
Memorivardo2018-03-10 15:04:44
PHP
Memorivardo, 2018-03-10 15:04:44

How to clone a git repository from php over ssh?

OS: Windows
Downloaded https://git-scm.com/download/win so that you can work with Git via cmd.
My project creates a folder and I need to clone the repository into it via PHP. I do it with code like this:

$query = 'git clone ssh://[email protected]*************.git G://**********************';
$tmp = exec($query);

PS The first asterisks are the path to the repository, the second - to the folder
When I run the $query command simply through cmd, cloning occurs without problems. And if you run it through PHP, the folder is deleted. What is the reason? How to fix?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question