很多时候我们有这样的需求:全局状态下是某个 git 账号和 Email。但是在某些特殊的项目下,想用不同的用户名和Email。
这时就需要给某个特定的项目设置。
Step1 进入 git 项目下
cd my-project
Step 2 设置本地的用户名
git config user.name "your name"
Step 3 设置Email
git config user.email "your email"
如果想要全局设置,需要增加 --global 参数
git config --global user.name "your name"
git config --global user.email "your email"