不同文件夹使用不同的Git用户

冰豆花 / 2024-10-06 / 原文

tee ~/.gitconfig <<EOF
[includeIf "gitdir:~/Desktop/Project/"]
  path = ~/Desktop/Project/.gitconfig
EOF

tee ~/Desktop/Project/.gitconfig <<EOF
[user]
  name = your_name
  email = your_mail
EOF