8

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?

Willi Mentzel
  • 27,862
  • 20
  • 113
  • 121

1 Answers1

1

This feature comes from Git 2.14 (Q3 2017), which includes some tests:

In case ~ is not properly replaces by %HOME%, try and use /C/ in your paths to check if this works better (for testing).

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250