Libgit2 works primarily on repositories that you have disk access to, meaning you have to clone the repository before you can use libgit2 to work with it.
Once you've got that, you'll get a handle to your repository using git_repository_open
, and create the branch using git_branch_create
.