Mac OS X Git安装教程

第一:下载:http://code.google.com/p/git-osx-installer/

下载最新的PGK文件。

图形化OpeninGitGui:

http://code.google.com/p/git-osx-installer 上也提供了一个Git的图形化客户端:OpenInGitGui,可以从这里获得,OpenInGitGui十分小巧,下载解压后也只有16K,OpenInGitGui不用安装,双击即可使用,OpenInGitGui刚启动时,会记录打开过的资源库。

第二:设置SSH

由于github使用SSH链接,需要设置SSH

1.检查SSH key

 cd ~/.ssh

2.备份已有的key,(如果有的话)

 mkdir key_backup

 mv id_rsa* key_backup

3.生成SSH key

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

4.将SSH key添加到GitHub

登录到GitHub页面,Account Settings->SSH Public Keys->Add another key

将生成的key(id_rsa.pub文件)内容copy到输入框中,save。

5.测试链接

  $ ssh git@github.com

出现上述提示信息说明连接成功(github并不提供shell登陆但已经连接成功)

第三:设置个人信息

  $ git config --global user.name"你的git用户名"

  $ git config --global user.email你的github邮箱
原文地址:https://www.cnblogs.com/fengtengfei/p/3940513.html