I have the following at the start of my .gitconfig:
[includeIf "gitdir/i:~/"]
{{ path = ~/.gitconfig-personal}}
[includeIf "gitdir/i:~/Development/_Public/"]
{{ path = ~/.gitconfig-github}}
The two files each contain the following:
[user]
{{ name = John Yeates}}
{{ email = my.email.address}}
with the email address differing (see https://help.github.com/articles/about-commit-email-addresses/ for why I do this — and please consider adding such a feature to Bitbucket, BTW…)
When I commit from the command-line, repos stored in ~/Development/Public have the email address in .gitconfig-github applied to them, rather than the one in ~/.gitconfig-personal.
However, when I try to commit in SourceTree, it does not parse either ~/.gitconfig-personal or ~/.gitconfig-github, and instead merely notes that there is no name or email defined in ~/.gitconfig, and prompts me to enter them.
This totally ruins the point of having this automation, because it means I now need to enter an email address manually for each repo.
Please could you support conditional configs? The easy way for name and email is to call `git config --get user.email` and `git config --get user.name` rather than parsing the .gitconfig yourself…
- is related to
-
SRCTREEWIN-8254 SourceTree does not respect includeIf conditionals in .gitconfig
-
- Gathering Impact
-