把配置中的 global 换成 system 即可。
global
system
git config --system user.email "you@example.com" git config --system user.name "Your Name"
amazon web services - AWS-Ubuntu-Git Setup error fatal: $HOME not set - Stack Overflow