美文网首页
ios 代码上传到github 需要生成ssh

ios 代码上传到github 需要生成ssh

作者: 天下林子 | 来源:发表于2018-03-24 10:24 被阅读423次

创建SSH Key

  1. $ ssh-keygen -t rsa -C 账户名 //直接各种回车
  2. 在电脑个人用户主目录找到隐藏文件夹 .ssh,打开有id_rsa、id_rsa.pub这两个文件
  3. id_rsa可以直接打开,id_rsa.pub苹果电脑不能打开,可以通过命令 (1)cd ~/.ssh 切换到目录 (2)more id_rsa.pub在终端直接显示出文件内容
C9322798-4062-4AD4-8CF0-ADB057A0F305.png
====

Last login: Thu Mar 22 14:02:07 on ttys002
cuilinhaodeMacBook-Pro:~ cuilinhao$ ssh-keygen -t rsa -C cuilinhao
Generating public/private rsa key pair.
Enter file in which to save the key (/Users/cuilinhao/.ssh/id_rsa): 
/Users/cuilinhao/.ssh/id_rsa already exists.
Overwrite (y/n)? y
Enter passphrase (empty for no passphrase): 
Enter same passphrase again: 
Passphrases do not match.  Try again.
Enter passphrase (empty for no passphrase): 
Enter same passphrase again: 
Your identification has been saved in /Users/cuilinhao/.ssh/id_rsa.
Your public key has been saved in /Users/cuilinhao/.ssh/id_rsa.pub.
The key fingerprint is:
SHA256:Esw8wwq5KB5HXw5ee4PuOwdOo/N9TGJ2cc80vCO7SBg cuilinhao
The key's randomart image is:
+---[RSA 2048]----+
|                 |
|   . =           |
|  o. .Oo      .  |
| ..oo.=+o  . . + |
|o....o.+SE  o + o|
|o o   .=.++o . = |
| .    +.=.=.  o .|
|     o.o...o..   |
|      o++... ..  

+----[SHA256]-----+



cuilinhaodeMacBook-Pro:~ cuilinhao$ defaults write com.apple.finder AppleShowAllFiles -bool YES 
cuilinhaodeMacBook-Pro:~ cuilinhao$ cd /Users/cuilinhao/.ssh 
cuilinhaodeMacBook-Pro:.ssh cuilinhao$ more  id_rsa.pub
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDDip6FABjmnHO4jWhorHnCPlNvHUq9BNXQemP0R15lxHZURZL5fp5hsupaPumROP2nzJ5/+M6EOnXFsvVIjfA1lP/+k+8+Ibzlio2Pnqab4R2FHjMZSaHTV0sZ1XqlUiaAaiLoLo2Q81k0BnxdnDcBlMGk+e0RPgYlm99y4OrEWERL7BB7YobG++LNwAVqy1CYDF8KhUkR3xS3hCAefK5n7hkn4FnFnP2TdLlHGJdypjyPXhDRE3Riy7UzxAfv+bdjx4GPL7te27iCazLPOwi0MJSEsFd+6hYqJp+2sbODS96rqEE/Bk0Fr/kzG/6XXZqd/7pclmy6xoz8RCJ96Y5V cuilinhao
...skipping...
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDDip6FABjmnHO4jWhorHnCPlNvHUq9BNXQemP0R15lxHZURZL5fp5hsupaPumROP2nzJ5/+M6EOnXFsvVIjfA1lP/+k+8+Ibzlio2Pnqab4R2FHjMZSaHTV0sZ1XqlUiaAaiLoLo2Q81k0BnxdnDcBlMGk+e0RPgYlm99y4OrEWERL7BB7YobG++LNwAVqy1CYDF8KhUkR3xS3hCAefK5n7hkn4FnFnP2TdLlHGJdypjyPXhDRE3Riy7UzxAfv+bdjx4GPL7te27iCazLPOwi0MJSEsFd+6hYqJp+2sbODS96rqEE/Bk0Fr/kzG/6XXZqd/7pclmy6xoz8RCJ96Y5V cuilinhao

到此就生成了,直接复制过去就可以了

=====================

~
cuilinhaodeMacBook-Pro:.ssh cuilinhao$ 
cuilinhaodeMacBook-Pro:.ssh cuilinhao$ cd /Users/cuilinhao/Desktop/aaaa 
cuilinhaodeMacBook-Pro:aaaa cuilinhao$  git clone https://github.com/cuilinhao/-Demo.git
Cloning into '-Demo'...
remote: Counting objects: 3, done.
remote: Total 3 (delta 0), reused 0 (delta 0), pack-reused 3
Unpacking objects: 100% (3/3), done.
cuilinhaodeMacBook-Pro:aaaa cuilinhao$ git add .
warning: adding embedded git repository: Desktop/aaaa/-Demo
hint: You've added another git repository inside your current repository.
hint: Clones of the outer repository will not contain the contents of
hint: the embedded repository and will not know how to obtain it.
hint: If you meant to add a submodule, use:
hint: 
hint:   git submodule add <url> Desktop/aaaa/-Demo
hint: 
hint: If you added this path by mistake, you can remove it from the
hint: index with:
hint: 
hint:   git rm --cached Desktop/aaaa/-Demo
hint: 
hint: See "git help submodule" for more information.
cuilinhaodeMacBook-Pro:aaaa cuilinhao$ git add .A
fatal: pathspec '.A' did not match any files
cuilinhaodeMacBook-Pro:aaaa cuilinhao$ cd /Users/cuilinhao/Desktop/aaaa/-Demo 
cuilinhaodeMacBook-Pro:-Demo cuilinhao$ git add -A
cuilinhaodeMacBook-Pro:-Demo cuilinhao$ git commit -m "aaa"
[master 0272f3a] aaa
 1 file changed, 596 insertions(+)
 create mode 100644 "\346\255\243\345\210\231\350\241\250\350\276\276\345\274\217.rtf"
cuilinhaodeMacBook-Pro:-Demo cuilinhao$ 

相关文章

  • ios 代码上传到github 需要生成ssh

    创建SSH Key $ ssh-keygen -t rsa -C 账户名 //直接各种回车 在电脑个人用户主...

  • ios 代码上传到github 需要生成ssh

    昨天用sourceTree从 gitlab上面第一次拉取代码.报这个错 解决办法:需要在电脑本地生成一SSH ke...

  • github 上传代码

    将文件上传到github过程 一 .生成ssh 命令1: ssh-keygen -t rsa -C '邮箱号' ...

  • Github + Travis

    Github    Github 是一个很好的开放源码代码托管平台。从本地上传代码,需要生成 ssh 秘钥,并将公...

  • 与远程版本库协作

    生成 SSH Key 想要在 GitHub 提交代码必须要先添加 SSH Key 配置。 指定 rsa 算法生成密...

  • Git常用命令

    SSH KEY 以github和gitee代码托管平台为例 检测本地是否生成过ssh keycd ~/.ssh &...

  • mac 生成 ssh keys

    mac 生成 ssh keys 使用github管理代码的时候 需要生成一个公钥key 添加到自己的git账户中...

  • 生成并部署SSH key

    在我们的实际工作中,需要在github上面拉取和提交代码,需要ssh key,下面介绍一下命令的方式快速生成ssh...

  • 上传代码到cocoaPods

    上传代码到cocoaPods,通过pod search 能搜索并下载 生成SSH Key,然后添加到GitHub上...

  • git 远程仓库

    代码需要储存在云端,github可以储存你的代码 SSH KEY如何验证身份? 电脑上放私钥,github账号里留...

网友评论

      本文标题:ios 代码上传到github 需要生成ssh

      本文链接:https://www.haomeiwen.com/subject/crcqcftx.html