fetch 命令中 logMessage 参数的用途是什么?
What is the purpose of the `logMessage` parameter in a fetch command?
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,从远程获取时不需要提供消息。参数说明说:
Log message for any ref updates.
但我不确定在这种情况下这意味着什么。
logMessage
参数控制在 reflog 中使用的消息。因此,如果提取任何提交,受影响分支的条目将使用该消息。
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,从远程获取时不需要提供消息。参数说明说:
Log message for any ref updates.
但我不确定在这种情况下这意味着什么。
logMessage
参数控制在 reflog 中使用的消息。因此,如果提取任何提交,受影响分支的条目将使用该消息。