[英]How to pull all new tags using libgit2sharp
我想使用libgit2sharp實現git pull --tags
。 如果我嘗試做這樣的拉力:
repo.Network.Pull(new Signature("name", "my@email.com", new DateTimeOffset()), new PullOptions());
然后我得到新的提交,但沒有指向這些提交的新標簽。 我試圖使用PullOptions
來修改這樣的行為:
var sig = new Signature("name", "my@email.com", new DateTimeOffset());
var opts = new PullOptions{ FetchOptions = new FetchOptions {TagFetchMode = TagFetchMode.All} };
repo.Network.Pull(sig, opts);
這將引發以下異常:
LibGit2Sharp.LibGit2SharpException: ref 'refs/remotes/origin/master' doesn't match the destination
at LibGit2Sharp.Core.Ensure.HandleError(Int32 result)
at LibGit2Sharp.Core.Ensure.ZeroResult(Int32 result)
at LibGit2Sharp.Core.Proxy.git_remote_fetch(RemoteSafeHandle remote, Signature signature, String logMessage)
at LibGit2Sharp.Network.DoFetch(RemoteSafeHandle remoteHandle, FetchOptions options, Signature signature, String logMessage)
at LibGit2Sharp.Network.Fetch(Remote remote, FetchOptions options, Signature signature, String logMessage)
at LibGit2Sharp.Network.Pull(Signature merger, PullOptions options)
有任何想法嗎?
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.