public void SetRemoteBranch(GitBranchInfo localBranch, string remoteName = "origin")
{
using (var repository = GetRepository())
{
Remote remote = repository.Network.Remotes[remoteName];
var branch = GetLib2GitBranch(localBranch);
repository.Branches.Update(branch,
b => b.Remote = remote.Name,
b => b.UpstreamBranch = localBranch.CanonicalName);
}
}