调试

git 命令

2017-09-19  本文已影响10人  AFlyLi

Mac生成SSH Keys
使用git管理代码的时候,需要生成一个公匙key,添加到自己的git账户中,才能从git上拉取,提交代码。
生成方法:
打开终端,输入”ssh-keygen” 让后系统提示输入文件保存位置等信息,连续按三次回车即可,生成的SSH key文件的保存路径会在终端中给出,终端输出如下:

lipengfeideMacBook-Pro:~ lipengfei$ ssh-keygen
Generating public/private rsa key pair.
Enter file in which to save the key (/Users/lipengfei/.ssh/id_rsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /Users/lipengfei/.ssh/id_rsa.
Your public key has been saved in /Users/lipengfei/.ssh/id_rsa.pub.
The key fingerprint is:
SHA256:6SwIt2oMG1QH11K3zZHnT2nO4FR93i7dsjJCY0y4qjY lipengfei@lipengfeideMacBook-Pro.local
The key's randomart image is:
+---[RSA 2048]----+
| ...o. . .. .|
| ..o .. +... .o|
| . . . o oo ..+|
| . ... + +o|
|. . . S+ o Bo.|
|o o o o. = .o++|
| = o ..oo . + |
|. o.E .. . o . |
| ....o . o |
+----[SHA256]-----+

然后再终端中输入: vim /Users/xxxxx/.ssh/id_rsa.pub 打开文件,将id_rsa.pub中的内容拷贝出来填入到git账户里面就ok了。

上一篇 下一篇

猜你喜欢

热点阅读