记录下给刚入门git的童鞋,少走点弯路。
步骤:
1. 安装windows的git.
2.到 https://code.youkuaiyun.com 创建项目,注意邮箱地址填csdn passport邮箱地址.
3.生成rsa pub公钥。
-- 参考文章
https://code.youkuaiyun.com/help/优快云_Code/code_support/FAQ_2_3
这里注意两点: 创建了~/.ssh 目录之后,要用git bash 进入这个目录,再执行生成密钥命令,这里的邮箱地址是你的csdn passport邮箱地址,csdn会根据这个地址对应上你的csdn id.还有就是提示让你输入文件名时,一定要起名为id_rsa,不然后边的提交到远程源码库会失败。
4.之后按照以下上传本地项目。
https://code.youkuaiyun.com/help/优快云_Code/code_support/FAQ_2_4
如果出现以下错误,那么就是你的公钥位置可能不在~/.ssh下(一个.pub公钥文件和一个没后缀的私钥),还有就是在项目管理里要添加这个.pub文件里的内容为公钥。
The authenticity of host 'code.youkuaiyun.com (223.6.248.58)' can't be established.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'code.youkuaiyun.com,223.6.248.58' (RSA) to the list of known hosts.
Read from socket failed: The connection was aborted
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
如果需要clone项目到本地:
$ git clone <项目url, 如git@code.youkuaiyun.com:xxx/xxx.git>
$ 做些更新
$ git push