79793753

Date: 2025-10-18 12:27:34
Score: 1
Natty:
Report link

It seems that there is no API to get or set git config using LibGit2Sharp. However, I was able to do it by simply starting git process with correct arguments:

var startInfo = new ProcessStartInfo
{
    FileName = "git",
    Arguments = "config --global user.email [email protected]",
    RedirectStandardOutput = true,
    RedirectStandardError = true,
    UseShellExecute = false,
    CreateNoWindow = true,
    WorkingDirectory = "."
};

var process = new Process { StartInfo = startInfo };
process.Start();
process.WaitForExit();

if (process.ExitCode != 0)
{
    throw new InvalidOperationException($"Process exited with non-zero code ({process.ExitCode}).");
}

In regards to running it on a Windows Arm64 device I was at least able to build a project with LibGit2Sharp as dependency using win-arm64 runtime flag:

dotnet build -r win-arm64

And during my quick research I've also found this article, that seems to prove it is possible to run .NET 8 apps on Arm64 machine. If I were you I would check if .NET SDK is correctly installed on the machine.

Reasons:
  • Blacklisted phrase (1): regards
  • Blacklisted phrase (1): this article
  • Long answer (-1):
  • Has code block (-0.5):
  • Low reputation (0.5):
Posted by: Gucu112