使用code.csdn.net管理开源项目

来源:互联网 发布:学弹钢琴的软件 编辑:程序博客网 时间:2024/06/02 06:16

记录下给刚入门git的童鞋,少走点弯路。


步骤:

1. 安装windows的git.

2.到 https://code.csdn.net 创建项目,注意邮箱地址填csdn passport邮箱地址.

3.生成rsa pub公钥。

-- 参考文章

https://code.csdn.net/help/CSDN_Code/code_support/FAQ_2_3

这里注意两点: 创建了~/.ssh 目录之后,要用git bash 进入这个目录,再执行生成密钥命令,这里的邮箱地址是你的csdn passport邮箱地址,csdn会根据这个地址对应上你的csdn id.还有就是提示让你输入文件名时,一定要起名为id_rsa,不然后边的提交到远程源码库会失败。


4.之后按照以下上传本地项目。

https://code.csdn.net/help/CSDN_Code/code_support/FAQ_2_4

如果出现以下错误,那么就是你的公钥位置可能不在~/.ssh下(一个.pub公钥文件和一个没后缀的私钥),还有就是在项目管理里要添加这个.pub文件里的内容为公钥。


[plain] view plain copy
 在CODE上查看代码片派生到我的代码片
  1. The authenticity of host 'code.csdn.net (223.6.248.58)' can't be established.  
  2.   
  3. Are you sure you want to continue connecting (yes/no)? yes  
  4. Warning: Permanently added 'code.csdn.net,223.6.248.58' (RSA) to the list of known hosts.  
  5. Read from socket failed: The connection was aborted  
  6. fatal: Could not read from remote repository.  
  7.   
  8. Please make sure you have the correct access rights  
  9. and the repository exists.  

如果需要clone项目到本地:

[plain] view plain copy
  1. $ git clone <项目url, 如git@code.csdn.net:xxx/xxx.git>  
  2. $ 做些更新  
  3. $ git push  
0 0
原创粉丝点击