cd ~/. ssh 檢查本機的ssh密鑰
若是提示:git
No such file or directory
說明是第一次使用gitgithub
生成新的SSH Key:shell
ssh-keygen -t rsa -C "郵件地址@youremail.com" # -C大寫,無需引號 Generating public/private rsa key pair. Enter file in which to save the key (/Users/your_user_directory/.ssh/id_rsa):<回車就好>
而後輸入密碼,能夠回車跳過,密碼是防止別人往你的項目中提交內容:hexo
Enter passphrase (empty for no passphrase):<輸入加密串>
Enter same passphrase again:<再次輸入加密串>
顯示成功設置ssh key:ssh
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)? # 直接輸入yes Hi cnfeat! You've successfully authenticated, but GitHub does not provide shell access
搞定收工。。。ide
參考: http://www.jianshu.com/p/05289a4bc8b2測試