git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Git credential-cache manager is not treating `path=` correctly

From
Jeff King <peff@peff.net>
Date
Aug 24, 2023, 14:44 UTC
Message-ID
<20230824144439.GB3108100@coredump.intra.peff.net>
In-Reply-To
<14F3D856-6A3B-45F8-B5FD-9CD5D0CB7C47@gmail.com>
On Wed, Aug 23, 2023 at 11:02:44PM +0200, Ganriel Nützi wrote:
Show 7 quoted lines
> What I did not get from the documentation ist that a “store” of a
> generic (without path) credential , e.g https://www.server.com will
> just overwrite the more specific ones already in there. (So that is
> the case in my test, right? And the prompt happens in the first fill
> because useHttpPath=true but there is nomore any credential entry in
> the cache which would match (only the generic but that does not
> match), right?)

Right, exactly. It's possible that other helpers may behave differently here, but certainly the scheme used by both "store" and "cache" is to delete/replace anything that matches with the new credential.

> I am not sure but I thought that using cache is safer than store
> because i generally dont want to have credentials on a disk.

It is safer. I used the "store" one while testing because it is easy to look at its internal state at any point with "cat ~/.git-credentials". :)

But the same logic should apply to "cache", and my "use two helpers" trick should work by giving it a separate socket, like:

  [credential]
  helper = cache
  [credential "https://www.server.com/repos/1.git"]
  # separate socket/daemon for path-respecting entries
  helper =
  helper = credential --socket=$HOME/.git-credential-cache/socket-path
  useHttpPath = true
-Peff
Previous: Ganriel Nützi
Message 4 of 4 in “Git credential-cache manager is not treating `path=` correctly”
  1. Gabriel NütziAug 23, 2023
  2. Jeff KingAug 23, 2023
  3. Ganriel NütziAug 23, 2023
  4. Jeff KingAug 24, 2023

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.