Git 在提交代码时,必须同时提供用户名和用户邮箱。你可以按下面的步骤一次性配置好:
全局配置(推荐,所有仓库共用)
git config --global user.name "你的英文名或昵称"
git config --global user.email "你的邮箱地址"仅对当前仓库生效(进去仓库目录后)
git config user.name "你的英文名或昵称"
git config user.email "你的邮箱地址"配置完再用
git config --list | grep user确认能看到 user.name 和 user.email 即可。之后重新执行 git commit 就可以了。