Is there a way to create a new clone of a git repo using libgit2? From the libgit2 usage guide (http://libgit2.github.com/api.html), various examples docs (http://schacon.github.com/libgit2-examples/ etc.) and the “repository” libgit2 api docs (http://libgit2.github.com/libgit2/group__git__repository.html) and other reading… I only see references to either opening an existing git repo dir, git_repository_open, or creating a new one, git_repository_init.
Is there something obvious I am missing? Perhaps the api equivalent of “git clone GIT-REPO-URL” is git_repository_init followed by … ?
No, that’s not yet implemented in libgit2. None of the network protocols are yet implemented in libgit2 as far as I know. libgit2 is still a work in progress; it is useful for inspecting an manipulating a local repository, but not for doing network operations yet. For now, if you want to do network operations like cloning (or even local cloning), you are going to need to just shell out to the regular
gitexecutable.