libgit2

git_clone_local_into

Version:

Perform a local clone into a repository

A "local clone" bypasses any git-aware protocols and simply copies over the object database from the source repository. It is often faster than a git-aware clone, but no verification of the data is performed, and can copy over too much data.

Signature

int git_clone_local_into(git_repository *repo, git_remote *remote, const git_checkout_options *co_opts, const char *branch, int link, const git_signature *signature);

Parameters

In
repo

the repository to use

In
remote

the remote repository to clone from

In
co_opts

options to use during checkout

const char *
In
branch

the branch to checkout after the clone, pass NULL for the remote's default branch

int
In
link

wether to use hardlinks instead of copying objects. This is only possible if both repositories are on the same filesystem.

In
signature

the identity used when updating the reflog

Returns

int

0 on success, any non-zero return value from a callback function, or a negative value to indicate an error (use giterr_last for a detailed error message)

Versions