执行git commit -m "Initial commit"提示未配置名字和邮箱(Please tell me who you are.)

git未配置全局user.name和user.email时,commit会提示配置:

>git commit -m "Initial commit"
*** Please tell me who you are.

Run

  git config --global user.email "you@example.com"
  git config --global user.name "Your Name"

to set your account's default identity.
Omit --global to set the identity only in this repository.

fatal: unable to auto-detect email address (got 'user@DESKTOP-FFEE.(none)')

如果不想配置全局或由于多账号不能配置全局时。可以配置单仓库名字和邮箱:

>git config --local user.name "your name"
>git config --local user.email "email@email.com"

查看仓库配置信息:

>git config --local --list
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

友情链接更多精彩内容