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