git: fatal unable to auto-detect email address

2020-05-15 07:51发布

I just cannot commit with git on Ubuntu 14.04

Error message is:

git: fatal unable to auto-detect email address (got "some wrong email")

I tried git-config with and without the --global option setting user.name and user.mail but nothing works

标签: git-config
10条回答
Bombasti
2楼-- · 2020-05-15 08:00

Steps to solve this problem

note: This problem mainly occurs due to which we haven't assigned our user name and email id in git so what we gonna do is assigning it in git

  1. Open git that you have installed
  2. Now we have to assign our user name and email id
  3. Just type git config --user.name <your_name> and click enter (you can mention or type any name you want)
  4. Similarly type git config --user.email <xyx@gmail.com> and click enter (you have to type your primary mail id)
  5. And that's it.

    Have a Good Day!!!.

查看更多
小情绪 Triste *
3楼-- · 2020-05-15 08:06

If git config --global user.email "you@domain.com" git config --global user.name "github_username"

Dont work like in my case, you can use:

git config --replace-all user.email "you@domain.com"
git config --replace-all user.name "github_username"
查看更多
我只想做你的唯一
4楼-- · 2020-05-15 08:07

Make sure you should be in your home directory not in local directory. while setting your username and e-mail ID.

git config --global user.email "you@domain.com"
git config --global user.name "github_username"

Then follow the procedure on GitHub.

查看更多
成全新的幸福
5楼-- · 2020-05-15 08:07

I'm running Ubuntu through Windows Subsystem for Linux and had properly set my credentials through Git Bash, including in VS Code's terminal (where I was getting the error every time I tried to commit.)

Apparently even tho VS is using Bash in the terminal, the UI git controls still run through Windows, where I had not set my credentials.

Setting the credentials in Windows Powershell fixed the issue

查看更多
在下西门庆
6楼-- · 2020-05-15 08:09

I met the same question just now,my problem lies in the ignorance of blank behind the "user.email" and "your_address_mail@domain.com".

 git config --global user.email "your_address_email@domain.com"

I hope it will help you.

查看更多
我欲成王,谁敢阻挡
7楼-- · 2020-05-15 08:12

Probably a typo mistake: set user.mail with no e. Fix it by setting user.email in the Global Configuration with

$ git config --global user.email "you@example.com"

Already been asked: Why Git is not allowing me to commit even after configuration?

To be sure Run:

$ git config --local -l
查看更多
登录 后发表回答