git: fatal unable to auto-detect email address
Git ConfigGit Config Problem Overview
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 Solutions
Solution 1 - Git Config
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 "[email protected]"
Already been asked: https://stackoverflow.com/questions/14662526/why-git-is-not-allowing-me-to-commit-even-after-configuration
To be sure Run:
$ git config --local -l
Solution 2 - Git Config
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 "[email protected]"
git config --global user.name "github_username"
Then follow the procedure on GitHub.
Solution 3 - Git Config
If git config --global user.email "[email protected]" git config --global user.name "github_username"
Dont work like in my case, you can use:
git config --replace-all user.email "[email protected]"
git config --replace-all user.name "github_username"
Solution 4 - Git Config
>fatal: unable to auto-detect email address (got 'jsiddharth@TheDEN.(none)')
I ran the following,
git config --global user.email "[email protected]"
git config --global user.name "my name"
repo init -u https://<domainname>/platform/manifest
Solution 5 - Git Config
I get this error when running git stash
. Fixed with:
git config --global user.email {emailaddress}
git config --global user.name {name}
Solution 6 - Git Config
I had this problem yesterday. Before in the my solution, chek this settings.
git config --global user.email "[email protected]"
git config --global user.name "your_name"
Where "user" is the user of the laptop.
Example: dias@dias-hp-pavilion$ git config --global dias.email ...
So, confirm the informations add, doing:
dias@dias-hp-pavilion:/home/dias$ git config --global dias.email
my_address_email@domain.com
dias@dias-hp-pavilion:/home/dias$ git config --global dias.name
my_name
or
nano /home/user_name/.gitconfig
and check this informations.
Doing it and the error persists, try another Git IDE (GUI Clients). I used git-cola and this error appeared, so I changed of IDE, and currently I use the CollabNet GitEye. Try you also!
I hope have helped!
Solution 7 - Git Config
Problem solved after I run those commands with sudo
Solution 8 - Git Config
Had similar problem, I'm fairly new so take this with a grain of salt but I needed to go up a directory first, set the username, then go back down to git repository.
cd ..
git config --global user.email "[email protected]"
git config --global user.name "your_name"
cd <your repository folder>
Hope this helps anyone else that gets stuck
Solution 9 - Git Config
I met the same question just now,my problem lies in the ignorance of blank behind the "user.email" and "[email protected]".
git config --global user.email "[email protected]"
I hope it will help you.
Solution 10 - Git Config
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
Solution 11 - Git Config
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
-
Open git that you have installed
-
Now we have to assign our user name and email id
-
Just type
git config --user.name <your_name>
and click enter (you can mention or type any name you want) -
Similarly type
git config --user.email <[email protected]>
and click enter (you have to type your primary mail id) -
And that's it.
Have a Good Day!!!.
Solution 12 - Git Config
1st Step : Go for the workstation In my case -> cd /c/Users/rashni/MyWS/WSpace
2nd Step : create a folder In my case -> mkdir config
3rd step : use command In my case -> git config --global user.name "rashni" In my case -> git config --global user.email [email protected]
4th step : To check all configuration(optional) In my case -> git config --list
Solution 13 - Git Config
For Visual Studio users:
- Open Visual Studio
- Click on Git menu > Source Control > Git Repository Settings > General
- Set the 'User name' and 'Email'
- Click 'OK'
Solution 14 - Git Config
just put $ git config --local -l first in working directory and then run config.
Solution 15 - Git Config
Just type 2 lines in git bash for example:
$ git config --global user.name "Nguyen Duc Mui"
$ git config --global user.email "[email protected]"
and run again
$ git commit -a -m "Initial commit. Added a gitignore file and a README file."
Solution 16 - Git Config
Let's First understand why you have this error:
git config
is a tool to set configuration variables. So the first thing to do is to identify your self with:
> git config --global user.name "Your_Name"
> git config --global user.email "[email protected]"
Every Git commit will use those credentials.
With --global
option, you will do it just one time.