>申請(qǐng)Github賬號(hào)
http://jingyan.baidu.com/article/455a9950abe0ada167277864.html
>Mac本機(jī)上面安裝Git
brew install git
>使用SSH把本機(jī)的Git連接網(wǎng)頁(yè)版Github
1、家目錄下是否存在.ssh文件夾,若沒(méi)有的話創(chuàng)建一個(gè)
//這里的your_email@youremail.com指的是申請(qǐng)Github賬號(hào)時(shí)候填寫(xiě)的郵箱```
2峻贮、在本地生成一個(gè)SSH-KEY自動(dòng)保存在id_rsa.pub文件中
```ssh-keygen -t rsa -C "your_email@youremail.com"```
這個(gè)過(guò)程中會(huì)有提示信息:
Enter passphrase(empty for no passphrase):
Enter same passphraseagain:
不用填寫(xiě)席怪,直接按回車便可。
3纤控、在網(wǎng)頁(yè)版的Github上新建SSH連接
Settings->SSH and GPG keys->new SSH key
Title:隨便填寫(xiě)
Key:將id_rsa.pub文件copy到這里
![屏幕快照 2017-02-10 上午11.35.05.png](http://upload-images.jianshu.io/upload_images/1832400-655a4bd3457b141c.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
4挂捻、驗(yàn)證連接是否成功
`ssh -T git@github.com`
The authenticity of host 'github.com (207.97.227.239)' 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)?
Hi username! You've successfully authenticated, but GitHub does not provide shell access.
出現(xiàn)如上信息便成功!
剛上面只能證明本機(jī)可以連接到Github船万,設(shè)置賬號(hào)和密碼磁能確保連接到具體的Github賬戶
#####>配置個(gè)人信息
`$git config --global user.name "your real name"`
`$git config --global user.email "xxxxx@gmail.com"`