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 protected]
[includeIf "gitdir:~/Development/Business/test/"]
path = ~/Development/Business/test/.gitconfig
~/Development/Business/test/.gitconfig
[user]
name = First Last
email = [email protected]
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 protected]
However, the expected outcome should be:
git config user.email
[email protected]
When I run git --show-origin user.email
the output is
file:C://.gitconfig [email protected]
Shouldn't it be pointing to test/.gitconfig?
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).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With