# Question about include feature in .gitconfig

2 messages from 2012-04-04 to 2012-04-04. Participants: Shouichi KAMIYA, Jeff King.
Thread: https://gitlist.dev/t/30150

## Shouichi KAMIYA, 2012-04-04 21:09

Subject: Question about include feature in .gitconfig
Message-ID: <CALOHgxG2q_6EN5HFs=btX2hF4jC7AaJuMu=2AqbCeZBD+wNj3w@mail.gmail.com>
URL: https://gitlist.dev/e/CALOHgxG2q_6EN5HFs%3DbtX2hF4jC7AaJuMu%3D2AqbCeZBD%2BwNj3w%40mail.gmail.com

```
Hello git users and developers,

I have a question about "include" feature in config file.
In .gitconfig I included .my_super_secret_file like below.

# .gitconfig
[include]
    path = .my_super_secret_file

# .my_super_secret_file
[github]
    password = foobar

Now, my question is return value of "git config --global github.password".
I expect it to return foobar but it returns nothing. Is this behavior expected?

Cheers!
Shouichi

-- 
Shouichi KAMIYA

```

## Jeff King, 2012-04-04 21:15

Subject: Re: Question about include feature in .gitconfig
Message-ID: <20120404211504.GA19421@sigill.intra.peff.net>
URL: https://gitlist.dev/e/20120404211504.GA19421%40sigill.intra.peff.net
In-Reply-To: <CALOHgxG2q_6EN5HFs=btX2hF4jC7AaJuMu=2AqbCeZBD+wNj3w@mail.gmail.com>

```
On Thu, Apr 05, 2012 at 06:09:41AM +0900, Shouichi KAMIYA wrote:

> I have a question about "include" feature in config file.
> In .gitconfig I included .my_super_secret_file like below.
> 
> # .gitconfig
> [include]
>     path = .my_super_secret_file
> 
> # .my_super_secret_file
> [github]
>     password = foobar
> 
> Now, my question is return value of "git config --global github.password".
> I expect it to return foobar but it returns nothing. Is this behavior expected?

Yes, that's the expected behavior. Includes are not followed by default
when you ask for the value from a _specific_ file, as you do with
"--global".

If you do "git config github.password", you will get the answer you
want. You can also use "git config --includes --global github.password"
if you want to search only ~/.gitconfig, but following includes.

-Peff

```
