參考:https://blog.csdn.net/baidu_35085676/article/details/53456884
如何給git添加ssh-key
1,查看家目錄下是否有.ssh
目錄
windows的根目錄一般指C:\Users\你的用戶名
2,若沒有則生成一個ssh-key
ssh-keygen -t rsa -C "[email protected]"
連按三次回車
3. 將.~/ssh/id_rsa.pub
內容加入你的github
中
4. 設置你的git用戶名及郵箱
用戶名:
git config --global user.name "name"
郵箱:git config --global user.email "[email protected]"
- 測試你的ssh-key
ssh -T [email protected]
輸入yes後若顯示 Hi xxx! You’ve successfully authenticated, but GitHub does not provide shell access.