Author Identity 不配置
错误信息
Author identity unknown *** Please tell me 谁你是.
快速摘要
你有不配置你的 Git 用户.name and 用户.email, 所以 Git cannot attribute 提交到你.
为什么发生
Git 是从不配置使用用户.name and 用户.email
你是 using Git on 新 machine or fresh 安装
全局配置是 reset or overwritten
最小示例
✗ 错误代码
git commit -m "Initial" # Author identity unknown✓ 修复代码
git config --global user.name "Your Name"
git config --global user.email "[email protected]"
git commit -m "Initial" # now succeedsGit 需要你的 name and email 到 attribute 提交. 设置它们使用 git 配置 --全局, 然后提交.
如何诊断
检查你的配置: git 配置用户.name and git 配置用户.email
检查全局配置: git 配置 --全局 --列表
如何修复
设置你的 identity globally: git 配置 --全局用户.name '你的 Name' && git 配置 --全局用户.email '你@示例.com'
设置它 for 只是这个仓库: git 配置用户.name '你的 Name' && git 配置用户.email '你@示例.com'
Retry 提交之后配置
如何预防
配置用户.name and 用户.email 当你首先安装 Git
Use --全局到设置它一次 for 所有仓库