libgit2

git_clone

Version:

Clone a remote repository.

This version handles the simple case. If you'd like to create the repository or remote with non-default settings, you can create and configure them and then use git_clone_into().

Signature

int git_clone(git_repository **out, const char *url, const char *local_path, const git_clone_options *options);

Parameters

In
out

pointer that will receive the resulting repository object

const char *
In
url

the remote repository to clone

const char *
In
local_path

local directory to clone to

In
options

configuration options for the clone. If NULL, the function works as though GIT_OPTIONS_INIT were passed.

Returns

int

0 on success, GIT_ERROR otherwise (use giterr_last for information about the error)

Versions