"***请告诉我你是谁."使用SSH密钥时 [英] "*** Please tell me who you are." when using SSH key
问题描述
添加ssh密钥并检查它是否成功通过身份验证后,我正在为ssh密钥使用git.但是我仍然不能提交代码
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 git@github.com
Hi my-git-username! You've successfully authenticated, but GitHub does not provide shell access.
但是我不能提交
$ git commit -m "Develop Dockerfile for shopContainer"
*** 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: unable to auto-detect email address (got 'vagrant@vagrant-ubuntu-trusty-64.(none)')
推荐答案
运行
git config --global user.email"you@example.com"
git config --global user.name您的名字"
Run
git config --global user.email "you@example.com"
git config --global user.name "Your Name"
注意:您已成功通过身份验证,但是git需要您的用户名&电子邮件
进行提交.
Note: You are authenticated successfully but git needs your username & email
to do a commit.
它与身份验证无关.您的用户名/电子邮件
可以与您的GitHub帐户不同.
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 "you@example.com"
$ git config --global user.name "Your Name"
$ git config --list # see if the 'name' & 'email' are set correctly
此 user.name
& user.email
将在〜/.gitconfig
文件中全局设置.
This user.name
& user.email
will be set globally in ~/.gitconfig
file.
$ cat ~/.gitconfig # see global config file
这篇关于"***请告诉我你是谁."使用SSH密钥时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!