我生成了SSH密钥并配置了我的Git和SourceTree。我可以从Git-bash执行git pull和其他操作。 注意:我已经在.bashrc中添加了以下内容以使其正常工作。
eval `ssh-agent`
ssh-add
然而,当我在SourceTree中尝试git pull时,出现以下情况。
git -c diff.mnemonicprefix=false -c core.quotepath=false fetch origin Permission denied (publickey,password). fatal: Could not read from remote repository.
请确保您拥有正确的访问权限并且存储库存在。
当我尝试从Putty(Windows)创建ssh密钥时,它会继续进行,但会等待以下消息!
git -c diff.mnemonicprefix=false -c core.quotepath=false fetch origin The server's host key is not cached in the registry. You have no guarantee that the server is the computer you think it is. The server's rsa2 key fingerprint is:
ssh-rsa 2048 0f:ee:bb:1c:6c:b4:50:0e:54:d6:e9:55:9b:38:45:df 如果您信任此主机,请输入“y”将密钥添加到PuTTY的缓存并继续连接。如果您想仅连接一次而无需将密钥添加到缓存,请输入“n”。如果您不信任此主机,请按Enter键放弃连接。
如果我在SourceTree中打开终端(即git-bash),它会要求我输入密码。因此,我怀疑我的.bashrc没有被SourceTree加载。或者我还遗漏了什么吗?