无法针对工作和个人环境分别自定义.gitconfig中的配置

Can't customize the configuration in .gitconfig separately for the work and personal environment

我有以下文件:

然后我进入文件夹C:\Development-Work\projects-git,右击一个项目文件夹Project和select乌龟Git客户的前任。 commit 命令和弹出窗口 window 显示我必须在提交之前设置用户名和电子邮件。

我的配置中遗漏了什么?谢谢你的帮助。


请确保您安装了足够新的 Git(对于 Windows)版本(IIRC 2.13 或更高版本,最好使用最新版本)。

Includeif 在 TortoiseGit 2.6.1 之前无法正常工作(参见 https://tortoisegit.org/issue/3184)。