Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"*** Please tell me who you are." when using SSH key

Tags:

git

github

I'm using ssh key for git, after I added ssh key and check it authenticated successfully. But I still cannot commit code

$ eval "$(ssh-agent -s)"
Agent pid 2599

$ ssh-add ~/id_rsa
Identity added: /home/vagrant/id_rsa (/home/vagrant/id_rsa)

$ssh -T [email protected]
Hi my-git-username! You've successfully authenticated, but GitHub does not provide shell access. 

But I cannot do commit

$ git commit -m "Develop Dockerfile for shopContainer"

*** Please tell me who you are.

Run

   git config --global user.email "[email protected]"
   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 'vagrant@vagrant-ubuntu-trusty-64.(none)')
like image 801
Charles PHAM Avatar asked Feb 20 '17 02:02

Charles PHAM


3 Answers

Run
git config --global user.email "[email protected]"
git config --global user.name "Your Name"

Note: You are authenticated successfully but git needs your username & email to do a commit.

It is not related to authentication. Your username/email can be different from your GitHub Account.

You need to run the following commands for a single time.

$ git config --global user.email "[email protected]" 
$ git config --global user.name "Your Name"

$ git config --list    # see if the 'name' & 'email' are set correctly

This user.name & user.email will be set globally in ~/.gitconfig file.

$ cat ~/.gitconfig     # see global config file

See more details

like image 77
Sajib Khan Avatar answered Oct 24 '22 15:10

Sajib Khan


The suggestions from other answers no longer work in 2020. To remove the repeated entries, this is now the way to go:

git config --global --unset-all user.name
git config --global --unset-all user.email

You might have to unset them locally as well, i.e. no --global flag. Then set them again as indicated in the other answers, i.e.:

$ git config --global user.name "Your Name"
$ git config --global user.email "[email protected]" 
like image 25
Daniel R. Avatar answered Oct 24 '22 14:10

Daniel R.


This error tells you to omit the --global from the command nothing else. to get rid of this error follow my steps...

just put this command in your git console ->

    $ git config user.email "[email protected]"
    $ git config user.name "Your name"

after this, your name and email will be set to the git and you are now ready to commit.

    $ git commit -m "Msg you want to print during commit"  ##This will commit successfully##

Output ->

    [master (root-commit) 7d5681a] done

    1 file changed, 1 insertion(+)

    create mode 100644 demo.txt

please let me know me if it is helpful to you guys.

like image 23
Sourav Nandy Avatar answered Oct 24 '22 14:10

Sourav Nandy