fetch命令中`logMessage`参数的用途是什么?

问题描述 投票:1回答:1

Fetch命令的一个参数是logMessage。以the wiki为例,它传入一个空字符串。

string logMessage = "";
using (var repo = new Repository("path/to/your/repo"))
{
    var remote = repo.Network.Remotes["origin"];
    var refSpecs = remote.FetchRefSpecs.Select(x => x.Specification);
    Commands.Fetch(repo, remote.Name, refSpecs, null, logMessage);
    //                                                ^^^^^^^^^^---- this
}
Console.WriteLine(logMessage);

无论如何,这究竟是什么?

据我所知,在git中,从远程获取时不需要提供消息。参数说明说:

记录任何ref更新的消息。

但我不确定这意味着什么。

git libgit2 libgit2sharp
1个回答
1
投票

logMessage参数控制reflog中使用的消息。因此,如果提取任何提交,受影响分支的条目将使用该消息。

© www.soinside.com 2019 - 2024. All rights reserved.