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

Re: gitconfig - interaction between credential.helper and includeIf

From
RVRyan Vu <ryanvu87@gmail.com>
Date
Jun 25, 2024, 16:53 UTC
Message-ID
<CAF4erGXkP3AR3dNvsqmo5FBLxOaGZhd9pHCHKsL8Q0BV5BiKJA@mail.gmail.com>
In-Reply-To
<20240625132001.GA535756@coredump.intra.peff.net>
Thank you! I have the configurations working now.
On Tue, Jun 25, 2024 at 6:20 AM Jeff King <peff@peff.net> wrote:
Show 31 quoted lines
>
> On Mon, Jun 24, 2024 at 10:59:33PM -0700, Ryan Vu wrote:
>
> > I created the following files:
> >
> > ``` ~/workspace/.gitconfig-workspace
> > [credential]
> >     helper = store --file ~/workspace/.git-credentials-workspace
> > ```
> >
> > ``` ~/.gitconfig
> > [credential]
> >     helper = store
> > [includeIf "gitdir:~/workspace/"]
> >     path = ~/workspace/.gitconfig-workspace
> > ```
>
> credential.helper is a multi-valued config key that forms a list, and
> Git will try each one in sequence. So in your ~/workspace repositories,
> you've configured _two_ helpers: a vanilla "store" and one with the
> --file option.
>
> You can reset the list with an empty string. So putting:
>
>   [credential]
>   helper =
>   helper = store --file ~/workspace/.git-credentials-workspace
>
> in your .gitconfig-workspace would do what you want.
>
> -Peff
Previous: Jeff King
Message 3 of 3 in “gitconfig - interaction between credential.helper and includeIf”
  1. Ryan VuJun 25, 2024
  2. Jeff KingJun 25, 2024
  3. Ryan VuJun 25, 2024

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.