title: How to pull latest from a specific remote branch without having need to provide user details?
body: <h3>Requirement:</h3>
  
  <p>Using <a href="https://github.com/libgit2/libgit2sharp" rel="nofollow noreferrer">libgit2sharp</a> I want to pull (fetch + merge) latest from a <strong>specific git remote branch</strong> to my <strong>currently checked out local branch</strong>, without having to pass any other argument, like user credentials etc. Basically I am trying to replicate <code>git pull origin my-remote-branch</code></p>
  
  <h3>Details:</h3>
  
  <p>I want to automate certain Git operations from C#. I can simply do what I want by invoking <code>git.exe</code> (if I know the path), like <code>git.exe --git-dir=my-repo-directory pull origin my-remote-branch</code>. Notice that here the only external parameters I have to supply are <code>my-repo-directory</code> and <code>my-remote-branch</code>. Git gets everything right, like the name, password, email, current working branch (even if it doesnt have remote attached) and git pull simply works. I dont have to pass any of those parameters manually. I assume Git gets them from current Git settings for the repo (from %HOME% folder?).</p>
  
  <p>Is there a way to simulate that in LibGit2Sharp?</p>
  
  <h3>What I tried:</h3>
  
  <pre><code>using (var repo = new Repository("my-repo-directory"))
  {
      PullOptions pullOptions = new PullOptions()
      {
          MergeOptions = new MergeOptions()
          {
              FastForwardStrategy = FastForwardStrategy.Default
          }
      };
  
      MergeResult mergeResult = Commands.Pull(
          repo,
          new Signature("my name", "my email", DateTimeOffset.Now), // I dont want to provide these
          pullOptions
      );
  }
  </code></pre>
  
  <p>Which fails since it says <code>there is no tracking branch</code>. I dont necessarily need a tracking remote branch. I just want to fetch latest from a specific random remote repo and perform automerge if possible.</p>
  
  <p>Just to see if it works I tried: </p>
  
  <pre><code>using (var repo = new Repository("my-repo-directory"))
  {
      var trackingBranch = repo.Branches["remotes/origin/my-remote-branch"];
  
      if (trackingBranch.IsRemote) // even though I dont want to set tracking branch like this
      {
          var branch = repo.Head;
          repo.Branches.Update(branch, b =&gt; b.TrackedBranch = trackingBranch.CanonicalName);
      }
  
      PullOptions pullOptions = new PullOptions()
      {
          MergeOptions = new MergeOptions()
          {
              FastForwardStrategy = FastForwardStrategy.Default
          }
      };
  
      MergeResult mergeResult = Commands.Pull(
          repo,
          new Signature("my name", "my email", DateTimeOffset.Now),
          pullOptions
      );
  }
  </code></pre>
  
  <p>This fails with</p>
  
  <blockquote>
    <p>request failed with status code: 401</p>
  </blockquote>
  
  <h3>Additional info:</h3>
  
  <p>I dont want to invoke git.exe directly because I cant hardcode the git exe path. Also, since I cant pass username, email etc at runtime, is there a way libgit2sharp get them by itself from the repository settings, like how git.exe does?</p>