如何給git添加 ssh-key

參考: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]"

  1. 測試你的ssh-key

ssh -T [email protected]


輸入yes後若顯示 Hi xxx! You’ve successfully authenticated, but GitHub does not provide shell access.

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章