In your `~/work` repos commits still use your personal email, even though you configured `includeIf` for work.
IntermediateTroubleshootingConfig, Line Endings, Files and Platform Quirks
Answer
Likely causes → The gitdir: pattern does not match: missing trailing slash (gitdir:~/work matches only that exact path), wrong case on Windows/macOS (use gitdir/i:), symlinked directories, the included file path is wrong, or the includeIf block comes before the personal [user] block, so the later value wins.
Diagnose →
cd ~/work/app
git config --show-origin --show-scope user.email
git config --list --show-origin | grep -i includeif
Fix → In ~/.gitconfig, put defaults first and the conditional include last:
[user]
name = Aditi Dev
email = [email protected]
[includeIf "gitdir:~/work/"]
path = ~/.gitconfig-work
~/.gitconfig-work contains [user] email = [email protected]. Fix already-made commits with git rebase -r --exec 'git commit --amend --no-edit --reset-author' origin/main.
Prevent → Verify with git config --show-origin user.email in a new work repo before the first commit.
More on Config, Line Endings, Files and Platform Quirks
`warning: in the working copy of 'app.sh', LF will be replaced by CRLF the next time Git touches it`Beginner`git diff` shows `old mode 100755` / `new mode 100644` for hundreds of files with no content change.BeginnerCloning on Windows fails with `error: unable to create file src/very/deep/.../component.test.ts: Filename too long`.BeginnerYou renamed `header.tsx` to `Header.tsx` on macOS. Locally everything builds, but Linux CI fails with `Module not found: Can't resolve './components/Header'`.IntermediateCheckout on Windows fails with `error: invalid path 'logs/2024-01-01T10:00:00.log'` (or `'docs/aux.md'`) and `fatal: unable to checkout working tree`.IntermediateClone prints `warning: the following paths have collided (e.g. case-sensitive paths on a case-insensitive filesystem) and only one from the same colliding group is in the working tree:`Intermediate