使用Octokit.net 0.30.0,如何检测给定的分叉是否在上游存储库的后面,如果是,我该如何追赶?
我能够弄清楚如何检查我的叉子是否是最新的,但我想不出在必要时进行更新:
var fork = await _githubClient.Repository.Get("my_username", "the_repo_name").ConfigureAwait(false);
var upstream = fork.Parent;
var compareResult = await _githubClient.Repository.Commit.Compare(fork.Owner.Login, fork.Name, fork.DefaultBranch, $"{upstream.Owner.Name}:{upstream.DefaultBranch}").ConfigureAwait(false);
if (compareResult.BehindBy > 0)
{
... how can I update my fork? ...
}