# Git config not working correctly with included configurations

4 messages from 2016-04-12 to 2016-04-12. Participants: Rudinei Goi Roecker, John Keeping, Jeff King.
Thread: https://gitlist.dev/t/42000

## Rudinei Goi Roecker, 2016-04-12 11:25

Subject: Git config not working correctly with included configurations
Message-ID: <assp.0910338c53.570CDB33.9020300@itflex.com.br>
URL: https://gitlist.dev/e/assp.0910338c53.570CDB33.9020300%40itflex.com.br

```
I'm having a problem with included configurations in ~/.gitconfig, when 
using this command:

git config --global user.email

It doesn't return anything, in commits it works as intended. The 
configuration looks like this:

~/.gitconfig
[include]
   path = .gitconfig.user
# ... more configurations

~/.gitconfig.user
[user]
   name = My Full Name
   email = myemail@example.com

I'm using Fedora 23, git version 2.5.5

```

## John Keeping, 2016-04-12 13:02

Subject: Re: Git config not working correctly with included configurations
Message-ID: <20160412130236.GA11013@serenity.lan>
URL: https://gitlist.dev/e/20160412130236.GA11013%40serenity.lan
In-Reply-To: <assp.0910338c53.570CDB33.9020300@itflex.com.br>

```
On Tue, Apr 12, 2016 at 08:25:39AM -0300, Rudinei Goi Roecker wrote:
> I'm having a problem with included configurations in ~/.gitconfig, when 
> using this command:
> 
> git config --global user.email


> It doesn't return anything, in commits it works as intended. The 
> configuration looks like this:

I think you need:

	git config --global --includes user.email

or simply:

	git config user.email

See the documentation of the --includes and --no-includes options in
git-config(1).

```

## Jeff King, 2016-04-12 15:50

Subject: Re: Git config not working correctly with included configurations
Message-ID: <20160412155000.GA21249@sigill.intra.peff.net>
URL: https://gitlist.dev/e/20160412155000.GA21249%40sigill.intra.peff.net
In-Reply-To: <assp.0910338c53.570CDB33.9020300@itflex.com.br>

```
On Tue, Apr 12, 2016 at 08:25:39AM -0300, Rudinei Goi Roecker wrote:

> I'm having a problem with included configurations in ~/.gitconfig, when
> using this command:
> 
> git config --global user.email

You need to turn on "--includes" explicitly. From "git help config" in
v2.8.0:

  --[no-]includes
    Respect include.* directives in config files when looking up
    values. Defaults to off when a specific file is given (e.g., using
    --file, --global, etc) and on when searching all config files.

> I'm using Fedora 23, git version 2.5.5

The rule above has always been the case, but the documentation made it
more clear in v2.8.0.

-Peff

```

## Rudinei Goi Roecker, 2016-04-12 16:03

Subject: Re: Git config not working correctly with included configurations
Message-ID: <assp.09106d5289.570D1C6E.50303@itflex.com.br>
URL: https://gitlist.dev/e/assp.09106d5289.570D1C6E.50303%40itflex.com.br
In-Reply-To: <20160412155000.GA21249@sigill.intra.peff.net>

```
Thanks, I didn't knew about that option, as Jeff King said, the 
documentation is way more explicit about how it works in 2.8.0

On 12-04-2016 12:50, Jeff King wrote:
> On Tue, Apr 12, 2016 at 08:25:39AM -0300, Rudinei Goi Roecker wrote:
>
>> I'm having a problem with included configurations in ~/.gitconfig, when
>> using this command:
>>
>> git config --global user.email
> You need to turn on "--includes" explicitly. From "git help config" in
> v2.8.0:
>
>    --[no-]includes
>      Respect include.* directives in config files when looking up
>      values. Defaults to off when a specific file is given (e.g., using
>      --file, --global, etc) and on when searching all config files.
>
>> I'm using Fedora 23, git version 2.5.5
> The rule above has always been the case, but the documentation made it
> more clear in v2.8.0.
>
> -Peff

```
