git-credential-manager
git-credential-manager copied to clipboard
dotnet tool install git-credential-manager
There are several Linux distributions that support .NET but can’t install deb packages. Installing or updating Git Credential Manager on these platforms is discouragingly awkward -- you have to download the binaries, decompress and copy to the path. Even on Debian and Ubuntu which can install deb packages, updating GCM is a manual process.
It would thus be handy to additionally distribute Git Credential Manager as a dotnet global tool that could be installed dotnet tool install -g git-credential-manager. For users with .NET installed, this is a super convenient way to install. Updating is as simple as dotnet tool update --global git-credential-manager. An advantage on all platforms is that the framework-dependent install size (4.5 MB) is much much smaller than self-contained binaries (65 MB).
For applications developed in Python, Go or Nodejs, distributing via language package manager is a popular option offered among alternatives. For example, http client httpie can be installed from PyPI pip install httpie as well as Linux distribution package managers or Snap.
Some observations:
- https://www.nuget.org/packages/Git-Credential-Manager/ is currently squatted by jetbrains, last updated 2020.
- A package can only contain at most one tool, so the UI helpers would have to be packaged separately, eg.
dotnet tool install --global git-credential-manager-github-ui.
- A package can only contain at most one tool
Curious - where did you find this information?
If DotNetToolSettings.xml declares more than one command, then the tool will fail to install:
However, I don't think there is any rule against including additional executable files that are not declared as tool commands.
A package can only contain at most one tool executable installed to $HOME/.dotnet.tools, so the UI helpers would have to be packaged separately
Thinking further, perhaps everything could be packaged together, writing a custom nuspec. While only the git-credential-manager shim would be installed to $HOME/.dotnet/tools, all the assemblies including GitHub.UI etc would be installed to eg. .dotnet/tools/.store/git-credential-manager-core/2.0.799-gef7f88243b/git-credential-manager-core/2.0.799-gef7f88243b/tools/net6.0/any, so they would have no problem finding each other.
A package can only contain at most one tool executable installed to $HOME/.dotnet.tools, so the UI helpers would have to be packaged separately
Thinking further, perhaps everything could be packaged together, writing a custom nuspec. While only the
git-credential-managershim would be installed to$HOME/.dotnet/tools, all the assemblies includingGitHub.UIetc would be installed to eg..dotnet/tools/.store/git-credential-manager-core/2.0.799-gef7f88243b/git-credential-manager-core/2.0.799-gef7f88243b/tools/net6.0/any, so they would have no problem finding each other.
Got an early version of this working today!
@ldennington I'm squatting both https://www.nuget.org/packages/git-credential-manager-core/ and https://www.nuget.org/packages/git-credential-manager with unlisted prerelease packages so can add you as an package owner whenever you're ready to publish to https://nuget.org/
@ldennington I'm squatting both https://www.nuget.org/packages/git-credential-manager-core/ and https://www.nuget.org/packages/git-credential-manager with unlisted prerelease packages so can add you as an package owner whenever you're ready to publish to https://nuget.org/
This is awesome! Thank you so much @hickford. Would you mind following these instructions to transfer both the git-credential-manager and the git-credential-manager-core packages to the git-credential-manager organization (you'll just specify git-credential-manager as the new owner name)?
We're officially live on nuget.org 🥳
https://www.nuget.org/packages/git-credential-manager/2.0.877