Re: Feature request: partial URL matching for credential config
- From
M Hickford <mirth.hickford@gmail.com>
- Date
- Sep 28, 2025, 14:13 UTC
- Message-ID
- <CAGJzqs=8QHB2UjECVpEB2_R85dG1oHg2F2ewDRVpun8XqbboKQ@mail.gmail.com>
- In-Reply-To
- <CAGJzqsn7BbaVckJ17XhsDHLtmS3OZPBG=oniwe+FRjhEwGc+Eg@mail.gmail.com>
On Sat, 27 Sept 2025 at 19:48, M Hickford <mirth.hickford@gmail.com> wrote:
Show 16 quoted lines
> > 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/gitcredentials > > > 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