Git 在提交代码时,必须同时提供用户名和用户邮箱。你可以按下面的步骤一次性配置好: 全局配置(推荐,所有仓库共用) ```bash git config --global user.name "你的英文名或昵称" git config --global user.email "你的邮箱地址" ``` 仅对当前仓库生效(进去仓库目录后) ```bash git config user.name "你的英文名或昵称" git config user.email "你的邮箱地址" ``` 配置完再用 ```bash git config --list | grep user ``` 确认能看到 `user.name` 和 `user.email` 即可。之后重新执行 `git commit` 就可以了。 Loading... Git 在提交代码时,必须同时提供用户名和用户邮箱。你可以按下面的步骤一次性配置好: 全局配置(推荐,所有仓库共用) ```bash git config --global user.name "你的英文名或昵称" git config --global user.email "你的邮箱地址" ``` 仅对当前仓库生效(进去仓库目录后) ```bash git config user.name "你的英文名或昵称" git config user.email "你的邮箱地址" ``` 配置完再用 ```bash git config --list | grep user ``` 确认能看到 `user.name` 和 `user.email` 即可。之后重新执行 `git commit` 就可以了。 最后修改:2025 年 12 月 29 日 © 允许规范转载 赞 如果觉得我的文章对你有用,请随意赞赏