Git学习之错误代码
介绍
- 在学习 Git 命令时,遇到了一些错误,特记录下来
错误
执行 git push 出错
- 错误代码:
git@github.com: Permission denied (publickey). fatal: Could not read from remote repository.
- 解决方法1:检查是否成功在远程仓库中添加了本机对应的 SSH Key,如果没有,添加后再次执行
- 解决方法2:检查本地Git仓库是否和该SSH key关联,即执行
ssh-add "你的 id-rsa 文件地址"
执行 ssh-add 出错
- 错误代码:
Could not open a connection to your authentication agent
- 解决方法:执行
ssh-agent bash
,然后再执行ssh-add