在添加 ssh 密钥并检查其身份验证是否成功后,我正在使用 git 的 ssh 密钥。但我仍然无法提交代码
$ 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] /cdn-cgi/l/email-protection
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 "[email protected] /cdn-cgi/l/email-protection"
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)')
Run
git config --全局用户.电子邮件“[电子邮件受保护] /cdn-cgi/l/email-protection"
git config --global user.name“你的名字”
Note:您已成功通过身份验证,但 git 需要您的username & email
进行提交。
它与身份验证无关。你的username/email
can be 与您的 GitHub 帐户不同。
您需要运行以下命令单次.
$ git config --global user.email "[email protected] /cdn-cgi/l/email-protection"
$ git config --global user.name "Your Name"
$ git config --list # see if the 'name' & 'email' are set correctly
This user.name
& user.email
将在全局设置~/.gitconfig
file.
$ cat ~/.gitconfig # see global config file
查看更多详情 https://github.com/sajibcse68/MyDailyLearn/blob/git/git/git-cheatsheet.md#configure-users-name-and-email
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)