Loading... Git是分布式的代码管理工具,远程的代码管理是基于ssh的,所以要使用远程的git则需要ssh的配置。如果未配置ssh key将无法clone远程代码仓库到本地。 - 第一步.创建user.name和email ``` git config --global user.name "EwdAger" git config --global user.email "ewdager@hotmail.com" ``` - 第二步.生成SSH密钥: 1. 查看是否已经有了ssh密钥:```cd ~/.ssh```,Windows用户的路径在```C:\Users\EwdAger\.ssh```下 如果是刚安装git则不会有此文件夹,有则备份删除 2. 生成ssh key `sudo ssh-keygen -t rsa -C "ewdager@hotmail.com"` 然后按三下回车 最后得到了两个文件:id_rsa和id_rsa.pub 3. 在github上添加ssh密钥,这要添加的是“id_rsa.pub”里面的公钥 用编辑器打开id_rsa.pub复制全部内容到github的settings的SSH and GPG keys设置中,title取个好记的名字就行。  4. 然后就能使用clone了 最后修改:2019 年 11 月 08 日 01 : 55 PM © 允许规范转载 赞赏 如果觉得我的文章对你有用,请随意赞赏 赞赏作者 支付宝微信