xcode 连接 github 进行代码版本控制

1:Mac电脑生成ssh密匙

命令行输入:

ssh-keygen -t rsa -C "你的github邮箱" 

回车:

  1. Generating public/private rsa key pair.  
  2. Enter file in which to save the key (/Users/mac/.ssh/id_rsa):   
  3. Enter passphrase (empty for no passphrase):   
  4. Enter same passphrase again:   
  5. Your identification has been saved in /Users/mac/.ssh/id_rsa.  
  6. Your public key has been saved in /Users/mac/.ssh/id_rsa.pub.  
  7. The key fingerprint is:  
  8. SHA256:1vO3ou0+VwPi632vsuRxx/AE4IZfkkWM8AjtZioWqcU xxxx@gmail.com  
  9. The key's randomart image is:  
  10. +---[RSA 2048]----+  
  11. |        .....+o  |  
  12. |         ..=.+.  |  
  13. |     . . .o * o  |  
  14. |      E  .++ + . |  
  15. |     o .S++ o o .|  
  16. |    . o..  +   *.|  
  17. |     . .    = o.=|  
  18. |           ==+.+ |  
  19. |          o=*B+.o|  
  20. +----[SHA256]-----+  

---------------------------------------------

生成的ssh会保存在.ssh文件夹中(一般为隐藏文件,用户根目录下)。

打开.ssh文件夹下的id_rsa.pub这个文件,将文件中的内容复制到github  》account setting 》SSH Keys 》Add SSH Key中。

在github上新建一个文件仓库

然后xcode就可以checkout github的仓库到本地中,在本地仓库新建一个iOS项目,最后 在xcode commit -》 push就可以到github上了。

中间有需要github的仓库地址,用户密码等省略了。

 

转载于:https://www.cnblogs.com/antlin/p/5672954.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值