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

Git Conditional Includes Question (possible bug?)

From
CHColton Hurst <colton@coltonhurst.com>
Date
Jan 29, 2021, 21:21 UTC
Message-ID
<1E4AB5E8-DD46-45CA-9A3F-C49F115BE0D4@coltonhurst.com>
Hello,
I am attempting to use Git conditional includes, but it does not seem to work for me. Can you please help me find out what I’m doing wrong?

[Expectation] When I run `cd ~/colton/github/coltonhurst.com` (this is a valid git repo) and then run `git config user.email`, I expect ‘colton@coltonhurst.com’ will be returned.

[Actual Result] When I run `cd ~/colton/github/coltonhurst.com` (this is a valid git repo) and then run `git config user.email`, nothing is returned.

Is this correct behavior? It seems like Git is not recognizing my `.gitconfig` file, and the configuration is not set correctly.

I’m using git version 2.30.0 with on a Mac version 11.1 (Big Sur) My main shell is: fish, version 3.1.2 I also have tested & have the same issues using: GNU bash, version 3.2.57(1)-release (x86_64-apple-darwin20)

To reproduce, I have the two files at the listed locations:
`.gitconfig` at: `~/`, with the following contents:
[user]
	name = Colton Hurst
[includeIf "gitdir:~/colton/github"]
	path = ~/colton/github/.gitconfig
[includeIf "gitdir:~/colton/sourcehut"]
	path = ~/colton/sourcehut/.gitconfig
`.gitconfig` at: `~/colton/github`, with the following contents:
[user]
	name = Colton Hurst
	email = colton@coltonhurst.com
This is the output from `git bugreport`:

[System Info] git version: git version 2.30.0 cpu: x86_64 no commit associated with this build sizeof-long: 8 sizeof-size_t: 8 shell-path: /bin/sh uname: Darwin 20.2.0 Darwin Kernel Version 20.2.0: Wed Dec 2 20:39:59 PST 2020; root:xnu-7195.60.75~1/RELEASE_X86_64 x86_64 compiler info: clang: 12.0.0 (clang-1200.0.32.28) libc info: no libc information available $SHELL (typically, interactive shell): /bin/zsh

Thank you for reading,
cdh
Next: Junio C Hamano
Message 1 of 3 in “Git Conditional Includes Question (possible bug?)”
  1. Colton HurstJan 29, 2021
  2. Junio C HamanoJan 29, 2021
  3. Colton HurstJan 31, 2021

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.