clone github代码时碰到的问题,查了下报错是ssh key有问题
1.重新设置下 自己的github名字和邮箱:
git config --global user.name 'github.name'
git config --global user.name 'github@email.com'
2.删除.ssh下的known_hosts文件,手动删除即可
3.输入git命令
ssh-keygen -t rsa -C "gihub@email.com"
会出现
Generating public/private rsa key pair.
Enter file in which to save the key (/Users/your_user_directory/.ssh/id_rsa):
将该文见的内容复制到github的ssh key
4.添加ssh key
5.在git 中输入命令
ssh -T git@github.com
会跳出很多提示, 输入yes即可
会有提示成功的信息
代码提交前要git pull,不然容易出错,即使是最新代码?
至此问题解决,感谢万能的网友