Re: Fwd: Q: use '-C' flag with 'git config --global'

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Apr 06, 2020 at 10:48:06AM +0200, Tomáš Procházka wrote:

> [includeIf "gitdir:~/Workspace/Showmax/"]
>    path = ~/Workspace/Showmax/.gitconfig
> [...]
> I get correct email setting if I run command without `--global` flag.
> But What I understand from the [`git-config`
> docs](https://git-scm.com/docs/git-config#_description) if no flag is
> passed the values are read from system, global and local.

Right, I'd expect that to work, but...

> If I run commands one by one, No returns the ~correct~ expected email:
> 
> ~ $ git -C <pwd/to/showmax/project> config --system user.email
> ~ $ git -C <pwd/to/showmax/project> config --global user.email
> tomas.prochazka5d@xxxxxxxxx
> ~ $ git -C <pwd/to/showmax/project> config --local user.email

There's another difference when asking to read from a specific file:
includes are not turned on by default. Try

  git -C ... config --global --includes user.email

This is covered briefly in git-config(1):

  --[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.

This can be confusing, but was necessary to keep compatibility with
scripted manipulations of those files when includes were introduced.

-Peff



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux