iTranslated by AI
The content below is an AI-generated translation. This is an experimental feature, and may contain errors. View original article
🌊
How to Fix Git includeIf Not Working
Conclusion
- Run
git initin the parent directory
Context
Referring to articles such as the ones above,
[user]
[includeIf "gitdir:~/private/"]
path = ~/.gitconfig-private
[includeIf "gitdir:~/works/"]
path = ~/.gitconfig-works
even if you configure it separately like this,
git config user.name //no response
no response is returned.
Solution
- In the case of
gitdir:~/works/, move to theworksfolder and rungit initthere.- Running
git initmakesincludeIfstart functioning.
- Running
Reference
Finally
I wasted three whole days on this.
Discussion