git-ecosystem / git-credential-manager

Secure, cross-platform Git credential storage with authentication to GitHub, Azure Repos, and other popular Git hosting services.
Other
6.66k stars 1.73k forks source link

Better documentation on git credential-manager store #1683

Open KirillOsenkov opened 1 month ago

KirillOsenkov commented 1 month ago

We are in a CI environment and can't use UI. We obtain a token for auth to push to Azure Repos, but not sure what's the right way to add the token to Git.

I'm failing to find good documentation on git credential-manager store. It just says you don't need to use it, but it probably implies I'm a regular user in a UI scenario, not a service account on a CI machine.

KirillOsenkov commented 1 month ago

This is all I see:

image

dscho commented 1 month ago

I think the canonical way to store a credential is via git credential approve, not via the credential helper. Does that help?

If you need to use git credential-manager store, here is the implementation of that command, and it looks as if it accepted the username and password input the same way as git credential approve, i.e. <key>=<value> pairs provided via stdin.

KirillOsenkov commented 1 month ago

Thanks, I'll look into approve (it wasn't very intuitive :))

The issue remains though - the docs for store are lacking. Whatever it's doing needs to be documented.

dscho commented 1 month ago

Thanks, I'll look into approve (it wasn't very intuitive :))

Heh. Git's credential machinery was not designed to be used like that. For pre-authentication, I think the idea was to use a non-interactive credential helper like git credential-netrc.

Granted, the only really useful credential helper that is shipped with Git for Windows (which you seem to need to be using) is GCM.

The issue remains though - the docs for store are lacking. Whatever it's doing needs to be documented.

This lack of documentation is probably due to the fact that this store subcommand is part of the "protocol" Git speaks to the credential helpers, as documented here: https://git-scm.com/docs/gitcredentials#_custom_helpers. Therefore, it's not really up to GCM how this subcommand works, it has to abide by Git's rules, which are already documented in the Git project 😉

KirillOsenkov commented 1 month ago

Understood, thanks for the explanation.

glorialilly88 commented 3 weeks ago

****someone strealing software Sims and data itenty theft Gloria Lilly accounts they getting accounts login glorialilly727 and switched accounts my Gmail glorialilly88@gmail.com please accounts on security my inhernent Wi-Fi nacho name to home at 5214 Burton Street Philadelphia PA 19124 these people are dangerous my son is I u right die trying poison my children and myself and chemicals UTF find out mixed accounts so find glorialilly727@gmail.com and stealing everything investments companies and inl need help please FBI agents and govement agents pengon military they into I believe terrorist

glorialilly88 commented 3 weeks ago

My name is Gloria Lilly and I trying into accounts they switch accounts and log me it's bad get credit cards do these stealing my inheritance accounts and glorialilly88@gmail.com is new Gmail glorialilly727@gmail.com was old with military family and families and all accounts stolen along with investments shareholders etc please government they has royle I living sewage and bugs infested and mold Jacqueline SWARTZ landlord has 3 bedrooms on property when only 2 this my son in ICU and need help for glorialilly88@gmail.com