Start by cloning this repository:
git clone https://github.com/GitCredentialManager/git-credential-managerYou also need the latest version of the .NET SDK which can be downloaded and installed from here.
The Git-Credential-Manager.sln solution can be opened and built in Visual Studio, Visual Studio for Mac, Visual Studio Code, or JetBrains Rider.
To build from inside an IDE, make sure to select the MacDebug or MacRelease solution configurations.
To build from the command line, run:
dotnet build -c MacDebugYou can find a copy of the installer .pkg file in out/osx/Installer.Mac/pkg/Debug.
The flat binaries can also be found in out/osx/Installer.Mac/pkg/Debug/payload.
To build from inside an IDE, make sure to select the WindowsDebug or WindowsRelease solution configurations.
To build from the command line, run:
dotnet build -c WindowsDebugYou can find a copy of the installer .exe file in out\windows\Installer.Windows\bin\Debug\net472.
The flat binaries can also be found in out\windows\Payload.Windows\bin\Debug\net472\win-x86.
The two available solution configurations are LinuxDebug and LinuxRelease.
To build from the command line, run:
dotnet build -c LinuxDebugYou can find a copy of the Debian package (.deb) file in out/linux/Packaging.Linux/deb/Debug.
The flat binaries can also be found in out/linux/Packaging.Linux/payload/Debug.
To debug from inside an IDE you'll want to set Git-Credential-Manager as the startup project, and specify one of get, store, or erase as a program argument.
To simulate Git interacting with GCM, when you start from your IDE of choice, you'll need to enter the following information over standard input:
protocol=http<LF>
host=<HOSTNAME><LF>
<LF>
<LF>
..where <HOSTNAME> is a supported hostname such as github.com, and <LF> is a line feed (or CRLF, we support both!).
You may also include the following optional fields, depending on your scenario:
username=<USERNAME><LF>
password=<PASSWORD><LF>
For more information about how Git interacts with credential helpers, please read Git's documentation.
If you want to debug an already running GCM process, set the GCM_DEBUG environment variable to 1 or true. The process will wait on launch for a debugger to attach before continuing.
This is useful when debugging interactions between GCM and Git, and you want Git to be the one launching us.
If you want to debug a release build or installation of GCM, you can set the GCM_TRACE environment variable to 1 to print trace information to standard error, or to an absolute file path to write trace information to a file.
For example:
$ GCM_TRACE=1 git-credential-manager-core version
> 18:47:56.526712 ...er/Application.cs:69 trace: [RunInternalAsync] Git Credential Manager version 2.0.124-beta+e1ebbe1517 (macOS, .NET 5.0) 'version'
> Git Credential Manager version 2.0.124-beta+e1ebbe1517 (macOS, .NET 5.0)If you want code coverage metrics these can be generated either from the command line:
$ dotnet test --collect:"XPlat Code Coverage" --settings=./.code-coverage/coverlet.settings.xmlOr via the VSCode Terminal/Run Task:
test with coverage
HTML reports can be generated using ReportGenerator, this should be installed during the build process, from the command line:
$ dotnet ~/.nuget/packages/reportgenerator/*/*/net6.0/ReportGenerator.dll -reports:./**/TestResults/**/coverage.cobertura.xml -targetdir:./out/code-coverageor
$ dotnet {$env:USERPROFILE}/.nuget/packages/reportgenerator/*/*/net6.0/ReportGenerator.dll -reports:./**/TestResults/**/coverage.cobertura.xml -targetdir:./out/code-coverageOr via VSCode Terminal/Run Task:
report coverage - nix
or
report coverage - win