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

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

From
TPTomáš Procházka <tomas.prochazka5d@gmail.com>
Date
Apr 6, 2020, 08:48 UTC
Message-ID
<CA+Sgv42bOAaRBX99EpgpnSkGXFCWFpED7hwdwkWmPSOKuL1VBg@mail.gmail.com>
In-Reply-To
<CA+Sgv42V+xfoJVoFpPkWREXT0yuKZDeMDEGa3y8NDVU-4D1iYA@mail.gmail.com>
Hi,
I'm running into issue that if I run `git -C <pwd/to/showmax/project>
config --global user.email` I don't get expected email.
Expected: tomas.prochazka@showmax.com
Got: tomas.prochazka5d@gmail.com
My config contains a little catch:
~/.gitconfig
```
[user]
       name = Tomáš Procházka
       email = tomas.prochazka5d@gmail.com
[includeIf "gitdir:~/Workspace/Showmax/"]
   path = ~/Workspace/Showmax/.gitconfig
```
~/Workspace/Showmax/.gitconfig
```
[user]
    name = Tomáš Procházka
    email = tomas.prochazka@showmax.com
```

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.

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@gmail.com ~ $ git -C <pwd/to/showmax/project> config --local user.email

Am I missing something? Thanks for the answer.

Regards Tomáš Procházka

Next: Jeff King
Message 1 of 4 in “Fwd: Q: use '-C' flag with 'git config --global'”
  1. Tomáš ProcházkaApr 6, 2020
  2. Jeff KingApr 6, 2020
  3. Junio C HamanoApr 6, 2020
  4. Jeff KingApr 6, 2020

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.