首页 > 其他 > 详细

如何将本地项目与github上的项目绑定

时间:2017-01-04 20:08:21      阅读:255      评论:0      收藏:0      [点我收藏+]

得到github项目的ssh协议地址

形如:·git@git.coding.net:wzw/leave-a-message.git·

在本地生成公钥

输入 ssh-keygen -t rsa -C “username@example.com”,( 注册的邮箱),接下来一路点击 enter 键即可

在github个人设置中创建并添加公钥

本地打开 id_rsa.pub 文件(或执行 $cat id_rsa.pub ),复制其中全部内容,添加到账户 “SSH 公钥” 页面 中,公钥名称可以随意起名字。
完成后点击 “添加”,然后输入密码或动态码即可添加完成。

在命令行测试,首次建立链接会要求信任主机。

  1. $ ssh -T git@git.coding.net // 注意 git.coding.net 接入到 CDN 上所以会解析多个不同的 host ip The authenticity of host ‘git.coding.net (61.146.73.68)’ can not be established. RSA key fingerprint is 98:ab:2b:30:60:00:82:86:bb:85:db:87:22:c4:4f:b1. Are you sure you want to continue connecting (yes/no)? yes Warning: Permanently added ‘git.coding.net,61.146.73.68’ (RSA) to the list of kn own hosts.
  2. Enter passphrase for key ‘/c/Users/Yuankai/.ssh/id_rsa’: Coding.net Tips : [Hello Kyle_lyk! You have connected to Coding.net by SSH successfully!]

在本地绑定

  1. git remote add origin git@git.coding.net:wzw/leave-a-message.git
  2. git add file
  3. git commit -m "xxx"
  4. git push

如何将本地项目与github上的项目绑定

原文:http://www.cnblogs.com/yldf/p/1690687675867590037466509d34e42f.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!