title: Pushing to bitbucket with libgit2sharp
body: <p>I'm trying to use libgit2sharp to push to my repo on bitbucket. I'm trying to do this:</p>
  
  <pre><code>repo.Network.Push(repo.Branches[branchName], pushOptions);
  </code></pre>
  
  <p>Everything seems fine, no exceptions are thrown and I get no errors in the callback, but when I check on bitbucket none of my commits are there. Other methods seem to work fine (ie I can create a new branch on bitbucket and then use libgit2sharp to fetch and see that I now have that branch locally). Is there anything that I might be missing here?</p>
  
  <p>edit:</p>
  
  <p>Tried to just make a small sample program to see if I can get this working no go. I don't know if my code will help but here it is:</p>
  
  <pre><code> class Program
  {
      static void Main(string[] args)
      {
          PushOptions options = new PushOptions();
          Credentials creds = new Credentials();
          creds.Username = "username";
          creds.Password = "password";
          options.Credentials = creds;
          options.OnPackBuilderProgress = Program.packBuilderProgressHandler;
          options.OnPushTransferProgress = Program.pushTransferProgressHandler;
          options.OnPushStatusError = Program.pushStatusErrorHandler;
          Repository repo = new Repository("E:/Ohad/Work/libgitTest");
  
          repo.Network.Push(repo.Branches["origin/master"], options);
  
          Console.WriteLine("Press enter to close...");
          Console.ReadLine();
      }
  
      public static bool packBuilderProgressHandler(PackBuilderStage stage, int current, int total)
      {
      Console.Out.WriteLine("packBuilder =&gt; " + current +  " / " + total);
          return true;
     }
      public static bool pushTransferProgressHandler(int current, int total, long bytes)
      {
      Console.Out.WriteLine("pushTransfer =&gt; " + current + " / " + total +  " , " + bytes);
      return true;
      }
      public static void pushStatusErrorHandler(PushStatusError error)
      {
          Console.Out.WriteLine("error =&gt; " + error.Message);
      }
  }
  </code></pre>
  
  <p>Just make a new repo on bitbucket and add the above code (changing the stuff thats hard coded) and it should be reproducible. I just made a random change, added and commited it and then used the program to try to push to bitbucket. The output that I am getting from the above is: </p>
  
  <pre><code>pushTransfer =&gt; 0 / 0 , 12
  pushTransfer =&gt; 0 / 0 , 32
  Press enter to close...
  </code></pre>
  
  <p>The 0/0 looks suspicious to me but I don't know what I'm doing wrong =/. Thanks for any help!! </p>
  
  <p>edit 2:
  I just added this:</p>
  
  <pre><code> repo.Branches.Update(repo.Head, delegate(BranchUpdater updater)
          {
              updater.Remote = "origin";
              updater.UpstreamBranch= repo.Head.CanonicalName;
          })
  </code></pre>
  
  <p>to before when I push and it fixed the issue. Not sure exactly why but I'll take it =).</p>