title: How to clone/fetch a git repository with libgit2?
body: <p>I need to initialize a git repository and fetch the latest version of a branch into it. In bash, the commands are:</p>
  
  <pre><code>git init
  git remote add -t $BRANCH -f origin $REMOTE
  </code></pre>
  
  <p>I'm trying to do the same programmatically with libgit2, but am having trouble finding the equivalent for the second line. The calls to create a remote are apparent, but I'm not seeing any to add it to a repository or handle the branch.</p>
  
  <p>Is it possible to do this with libgit2? If not, is there a library capable of doing this?</p>