Windows 生成公钥....使用git 管理阿里云code

windows环境下 生成公钥和私钥

  1. 上传代码到远程仓库的时候需要秘钥进行验证是否本人上传的。打开Git目录下的Git Bash

    输入ssh-keygen,回车
  2. 可直接不输入路径,使用默认路径(c/Users/Administrator/.ssh/)
  3. 按照提示要输入两次密码,但是如果输入了,每次操作操作git库时都要输入密码,所以选择不输入密码
  4. 密码输入结束后,提示已生成秘钥
  5. 打开c:/Users/Administrator/.ssh/,在文件中,id_rsa是私钥文件,id_rsa.pub是公钥文件
  6. 将公钥文件内容添加到github中的ssh公钥
  7. 回到git bash,输入

    ssh -T git@git.oschina.net
  8. 如果显示 'Welcome to Git@OSC, your username!',则表示成功

修改本地的ssh remote url。不用https协议,改用git协议

  1. 查看当前的remote url,可以看到是使用https协议进行访问的

    git remote -v  
    
    orgin https://github.com/xxx/xxx.git(fetch)  
    orgin https://github.com/xxx/xxx.git(push)
  2. 调整url,使用项目的ssh url

    git remote set-url origin git@github.com:xxx/xxx.git

参考:http://jingyan.baidu.com/article/948f5924ee425dd80ff5f90c.html

 

>> 安装git后的准备
https://code.aliyun.com/profile/keys
https://code.aliyun.com/help/ssh/README

>> 1. 将源码checkout到本地
找到你要放源码的目录,空白处 右键>>Git Bash Here,, 然后执行下面命令即可获取源码

git clone git@code.aliyun.com:your_project.git

>>2. 修改源码后,例:yourfile.html文件
git add yourpath/yourfile.html
git commit -m "add xxxx"
git push

https://crp.aliyun.com/projects/。。。。

 

转载于:https://www.cnblogs.com/duanweishi/p/7290007.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值