关于git提交代码时报错Committer identity unknown的解决方案

今天安装好git后,创建新项目,当git上传提交时出现了一个问题,如下:

解释

Commit failed - exit code 128 received, with output: '*** 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: empty ident name (for <>) not allowed'

提示:Please tell me who you are.

翻译过来就是:请告诉我你是谁。
就是说这里git无法识别你是谁,你需要告诉 git 你的身份。
其实提示已经告诉了你的问题:

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

所以我找到的 解决办法是在 终端 || 命令行 输入你的邮箱与名称(也就是账号和密码):

git config --global user.email "邮箱"
git config --global user.name "名称"

在命令行输入回车之后,发现不会出现这个问题了。

注意:git config命令的–global参数,用了这个参数,表示你这台机器上所有的Git仓库都会使用这个配置,当然也可以对某个仓库指定不同的用户名和Email地址。

你也可以通过以下命令来查看你的配置信息:

git config -l

总的来说:这是因为Git是分布式版本控制系统,所以,它必须要识别于你来自哪一个身份:你的名字和邮箱地址。

相关推荐

  1. 使用git提交代码时候出现403怎么解决

    2024-03-19 16:52:03       22 阅读
  2. 阿里云git clone超时报解决方法

    2024-03-19 16:52:03       66 阅读

最近更新

  1. docker php8.1+nginx base 镜像 dockerfile 配置

    2024-03-19 16:52:03       94 阅读
  2. Could not load dynamic library ‘cudart64_100.dll‘

    2024-03-19 16:52:03       101 阅读
  3. 在Django里面运行非项目文件

    2024-03-19 16:52:03       82 阅读
  4. Python语言-面向对象

    2024-03-19 16:52:03       91 阅读

热门阅读

  1. leetcode 9. 回文数

    2024-03-19 16:52:03       42 阅读
  2. Mybatis Plus代码生成code

    2024-03-19 16:52:03       45 阅读
  3. 关于服务器被入侵的个人日志(┬┬﹏┬┬)

    2024-03-19 16:52:03       43 阅读
  4. centos 7 添加启动脚本

    2024-03-19 16:52:03       37 阅读
  5. MySQL实战45讲

    2024-03-19 16:52:03       36 阅读
  6. 蓝桥杯算法基础(25)边长为1的最大子方阵优化

    2024-03-19 16:52:03       39 阅读
  7. 获取所有LOF基金实时行情数据

    2024-03-19 16:52:03       37 阅读
  8. Mysql 数据如何储存?

    2024-03-19 16:52:03       37 阅读
  9. Python使用Scapy库修改pcap包MAC地址

    2024-03-19 16:52:03       40 阅读
  10. P1266 速度限制(最短路 迪杰斯特拉算法)

    2024-03-19 16:52:03       44 阅读