Git - [includeIf] multiple gitconfigs not working

Viewed 2673

I'm trying to get multiple gitconfigs working on my repos use [includeIf]. I have a regular repo at: ~/Development/Business/work/ and a test repo at ~/Development/Business/test/.

The following global gitconfig and specific gitconfigs are as follow:

~.gitconfig

[user]
    name = First Last
    email = email@email.com
    
[includeIf "gitdir:~/Development/Business/test/"]
    path = ~/Development/Business/test/.gitconfig

~/Development/Business/test/.gitconfig

[user]
    name = First Last
    email = test@email.com

My HOME environmental variable is C:\

When I run git config user.email on the path ~/Development/Business/test/repo1 I receive the following output:

git config user.email
email@email.com

However, the expected outcome should be:

git config user.email
test@email.com

When I run git --show-origin user.email the output is

file:C://.gitconfig email@email.com

Shouldn't it be pointing to test/.gitconfig?

1 Answers
Related