There are now two programmatic ways how to clone a repository. VS Code handles the vscode://
protocol now, so you could clone a repository by clicking on a link somewhere on a web page
For example, clicking on the following link invokes VS Code, lets you select a folder on your disk, fetches the code and finally suggests to open that location as a workspace.
vscode://vscode.git/clone?url=https%3A%2F%2Fgithub.com%2Fmicrosoft%2Fvscode-extension-samples
Alternatively, if you are trying to trigger the cloning from an extension code, use the built-in VS Code command git.clone
with the repo url as the only argument.
import { commands} from 'vscode';
commands.executeCommand("git.clone", "https://github.com/microsoft/vscode-extension-samples");
Both seem to do the same as the Git: Clone command mentioned by Jakub.
git clone yourrepo
?