全局默认配置了用户名以及邮箱,现在需要给 Developer 文件夹配置单独的用户名、邮箱,如何解?

全局配置文件 .gitconfig

增加 includeIf 配置

# ...
[includeIf "gitdir:~/Work/"]
	path = ~/Work/.gitconfig

[includeIf "gitdir:~/"]
	path = ~/.gitconfig

目标文件夹 Work

新增 .gitconfig 配置文件

[user]
     name = example_name
     email = [email protected]
[core]
     sshCommand = ssh -i ~/.ssh/work

Reference