码迷,mamicode.com
首页 > 系统相关 > 详细

MAC OSX 安装Git

时间:2015-04-21 01:39:29      阅读:207      评论:0      收藏:0      [点我收藏+]

标签:

先下载https://code.google.com/p/git-osx-installer/

安装 控制台输入git --version查看是否安装

生成SSH key

ssh-keygen -t rsa -C "your_email"

回车会出现

Generating public/private rsa key pair.

Enter file in which to save the key (/Users/qifeng/.ssh/id_rsa): shinit_test

Enter passphrase (empty for no passphrase):

如果设置密码就输入,不设置就回车

Your identification has been saved in shinit_test.

Your public key has been saved in shinit_test.pub.

生成完成,运行命令的当前目录,本机生成在家目录下

然后添加私钥

ssh-add shinit_test

登陆github添加分钥即shinit_test.pub文件中的字符串

测试连接

ssh git@github.com

The authenticity of host ‘github.com (192.30.252.129)‘ can‘t be established.

RSA key fingerprint is 16:27:ac:a5:76:28:2d:36:63:1b:56:4d:eb:df:a6:48.

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

Warning: Permanently added ‘github.com,192.30.252.129‘ (RSA) to the list of known hosts.

Connection to github.com closed.

MAC OSX 安装Git

标签:

原文地址:http://www.cnblogs.com/qifeng1991/p/4443087.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!