Mac如何安装gitee或者github

第一步:首先进入官网下载官方下载地址:
https://git-scm.com/downloads/

Mac如何安装gitee或者github_第1张图片进入官网后选择Mac OS X

我没有选择在终端下载,我在火狐安装了网页翻译组件,然后选择了第三个tim公司提供的dmg傻瓜式安装包,安装好之后,我们可以在终端进行gitee(码云)的公钥本地安装

第二步:安装公钥
这是我在终端中的操作过程,后面有具体几条命令
在这里插入图片描述
*

  • Last login: Fri Jun 26 07:02:56 on console zhangwenhan@Json ~ %
    ssh-keygen -t rsa -C"Administrator@PC-20171006QOXX" Generating
    public/private rsa key pair. Enter file in which to save the key
    (/Users/zhangwenhan/.ssh/id_rsa): Created directory
    ‘/Users/zhangwenhan/.ssh’. Enter passphrase (empty for no
    passphrase): Enter same passphrase again: Your identification
    has been saved in /Users/zhangwenhan/.ssh/id_rsa. Your public key
    has been saved in /Users/zhangwenhan/.ssh/id_rsa.pub. The key
    fingerprint is:
    SHA256:LMKsVeXi8OvjsvlmR+NSqr+qy6CJPd3l+s+MJZsMWPE
    Administrator@PC-20171006QOXX The key’s randomart image is:
    ±–[RSA 3072]----+ | . | | o | | . + . | | o = = | | = = E | | o + o=
    | |. …oB… | |o=. ooBo+O | |+ =+=@BB*.+ |
    ±—[SHA256]-----+ zhangwenhan@Json ~ % cat ~/.ssh/id_rsa.pub ssh-rsa
    AAAAB3NzaC1yc2EAAAADAQABAAABgQCpTQjtt4voOpoVDRpRiBzGJrC8WGNwhascqGDltFLnmEHezYl94DFqn5mFCOGxTm+OX8w3ZStjI1yVRYXtgY64th6+iMsGNuaaqZDU2lzYvTN1+iIUgZs03erMVmEWm8bwrZeWyISeV2TASf097D0vojiDYAXWUgdZEe4J1uanz28AHJGBya5xTtL6+68FRNo7UKXGw0O0swBBE4puTQHitH14zgjgR1osHL9x2TIx4087wvWFduWp6YP3NjEgAUxAYrlwk51qvced6v/RbZz20jc1JK3F8Odij4e2/SyDi2Euf2sYRVbQk7okvCJVYicasISvPUwuw8eaD+XHm1ACchu8dPu7V4T4WuqZ1r3xi28HjEYpQGurBrjo559cGdn456oGJ0rpSrV2ecfVheHVE/ueuZXSN42tm92iWbykRycD2NYnqsuKiQ46HEyGk8/ECQZlBIN4Re+Qd2vCz0jMG19P+39Mxa/GYyiDLwcUlBkJIgND+FEl+uLFq+1G32c=
    Administrator@PC-20171006QOXX zhangwenhan@Json ~ % ssh -T
    [email protected] The authenticity of host ‘gitee.com
    (212.64.62.174)’ can’t be established. ECDSA key fingerprint is
    SHA256:FQGC9Kn/eye1W8icdBgrQp+KkGYoFgbVr17bmjey0Wc. Are you sure
    you want to continue connecting (yes/no/[fingerprint])? yes
    Warning: Permanently added ‘gitee.com,212.64.62.174’ (ECDSA) to
    the list of known hosts. [email protected]: Permission denied
    (publickey). zhangwenhan@Json ~ % ssh -T [email protected]
    [email protected]: Permission denied (publickey). zhangwenhan@Json ~
    % ssh -T [email protected] Enter passphrase for key
    ‘/Users/zhangwenhan/.ssh/id_rsa’: Hi honey128128! You’ve
    successfully authenticated, but GITEE.COM does not provide shell
    access. zhangwenhan@Json ~ %

上面在终端的操作过程,下面解释操作命令和出现问题的解决
在Mac实用工具中打开终端(terminal) ,配置SSH key(SSH key 可以让你在你的电脑和项目之间建立安全的加密连接),以码云为例。

ssh-keygen -t rsa -C “[email protected]

查看你的public key

cat ~/.ssh/id_rsa.pub

添加后,在终端(Terminal)中输入

ssh -T [email protected]

若返回:

Welcome to Gitee.com, 你的name!

则配置成功。

若提示不正确错误:

Are you sure you want to continue connecting (yes/no)?

输入yes继续回车就可以了。然后在重复输入ssh -T [email protected],回车则会提示正确。

如果yes/no,选择yes了之后还是不行。我们需要在码云官网,把在终端显示的公钥复制到公钥管理位置

Mac如何安装gitee或者github_第2张图片

最后再输入

ssh -T [email protected]

终端就会出现
Hi honey128128! You’ve successfully authenticated, but GITEE.COM does not provide shell access.
参考作者:西贝槑
链接:https://www.jianshu.com/p/34d1d5fa4382

你可能感兴趣的:(软件安装,git,mac)