Re: Feature request: partial URL matching for credential config
From: M Hickford <hidden>
Date: 2025-09-28 14:14:46
On Sat, 27 Sept 2025 at 19:48, M Hickford [off-list ref] wrote:
Hi. A git-credential-oauth user would like to define separate credential config for two URLs prefixes of the same host (eg. https://example.com/org1/* and http://example.com/org2/*) https://github.com/hickford/git-credential-oauth/issues/83 I don't believe this is currently possible https://git-scm.com/docs/gitcredentialsquoted
If the "pattern" URL does include a path component, then this too must match exactly: the context https://example.com/bar/baz.git will match a config entry for https://example.com/bar/baz.git (in addition to matching the config entry for https://example.com) but will not match a config entry for https://example.com/bar.Any thoughts on adding support for URL prefix matching? Example syntax could be credential.https://example.com/org1/*.key (explicit wildcard) or credential.https://example.com/org1/.key (implicit wildcard)
Here's a simpler example without OAuth -- configuring a personal username for https://git.example.com and an enterprise username for URLs beginning https://git.example.com/syscorp/ credential.https://git.example.com.username=tim credential.https://git.example.com/syscorp/.username=timothy.smith