背景:
我有一个用github很好的个人帐户,然后我的雇主给了我一个新的github帐户,所以我配置了我的github帐户来使用我的机器生成的SSH密钥。现在我的旧机器被更换了..。
如何将这台新机器配置为github的签入签出代码。
是否生成并向帐户添加另一个密钥?它还要求我发电子邮件给我的旧account..when (xxx@y.com)(在git集线器上添加的电子邮件),上面写着:
error: invalid key: xxx@y.com
直接加上它说
*** 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 'x y@DESKTOP-8ITRR8F.(no ne)')
更新
windows 10不允许在c:/user/samra/..当我试图生成密钥(认为它可能在此过程中创建.ssh )时,它说
Saving key failed: No such file or directory found
发布于 2017-04-12 06:47:21
生成另一个ssh键的步骤:
它现在应该返回代理pid,再次重复步骤8。
在.ssh文件夹中创建配置文件并键入
#Default GitHub
Host github.com
HostName github.com
User git
IdentityFile ~/.ssh/id_rsa
Host github-ge
HostName github.com
User git
IdentityFile ~/.ssh/id_rsa_ge
现在使用git
git add .
git commit ...
git push origin master
注意:在重新安装操作系统之前,请始终备份密钥。
发布于 2017-04-12 06:01:02
1.)电子邮件地址配置是为您的本地副本,它与github无关,git需要知道您的信息,这样它就可以在您提交时填写它。
2.)键--当然,您可以生成一个新密钥并将其添加到github,或者您可以将私有/公共密钥区复制到您的新机器上,在Linux机器上您通常可以在~/..ssh中找到它。
3.)您所得到的错误是,因为您的新机器上还没有有效的密钥。这有点像你尝试用密码登录,而不是输入密码,你只点击enter.没有键,没有访问;-)所以你在2中有两个选项。)来解决这个问题。
https://stackoverflow.com/questions/43361253
复制相似问题