Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/linux/22.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/git/21.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Linux 提交-m在转移更改后不工作_Linux_Git_Github_Git Commit_Git Config - Fatal编程技术网

Linux 提交-m在转移更改后不工作

Linux 提交-m在转移更改后不工作,linux,git,github,git-commit,git-config,Linux,Git,Github,Git Commit,Git Config,我以前曾多次使用git,但自从我安装了新的Linux之后,我就无法提交我的更改。我一直收到这个错误: *** 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

我以前曾多次使用git,但自从我安装了新的Linux之后,我就无法提交我的更改。我一直收到这个错误:

*** 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 <my@mail.com>) not allowed

Git需要知道您的个人名称user.name和电子邮件地址user.email,以便在提交和标记中嵌入这些值。在您的情况下,您有一个有效的电子邮件地址,但您没有指定个人名称


您应该运行git config命令,按照上面的建议设置user.name。请注意,这不是您在任何系统上的用户名,而是您的个人姓名,例如Pat Doe或Sam Smith。凭据在任何方面都与此无关。

我感谢您的帮助,但是,我仍然不断收到相同的错误。有没有办法重置全局用户名和电子邮件?请编辑您的问题,将git config-l的输出包括在内--将源代码显示为代码块。它正确显示了我的全局用户和电子邮件,并在我运行git config命令时进行更新。您是否安装了两个不同版本的git,其中一个使用/home/george/.gitconfig作为-global设置,另一个使用其他目录作为-global设置?
    git config -l --show-origin
    file:/home/george/.gitconfig    user.email=my@mail.com
    file:/home/george/.gitconfig    user.name=George Lastname
    file:.git/config        core.repositoryformatversion=0
    file:.git/config        core.filemode=true
    file:.git/config        core.bare=false
    file:.git/config        core.logallrefupdates=true
    file:.git/config        remote.origin.url=https://github.com/mygithub/repo
    file:.git/config        remote.origin.fetch=+refs/heads/*:refs/remotes/origin/*
    file:.git/config        branch.master.remote=origin
    file:.git/config        branch.master.merge=refs/heads/master