- git用戶端輸入ssh-keygen -t rsa -C "你的郵箱位址"
-
Enter file in which to save the key (C:\Users\Administrator\.ssh\id_rsa): #不填直接回車
Enter passphrase (empty for no passphrase): #不設定密碼直接回車
Enter same passphrase again: #不設定密碼直接回車
Your identification has been saved in C:\Users\Administrator\.ssh\id_rsa. #生成的密鑰位置
Your public key has been saved in C:\Users\Administrator\.ssh\id_rsa.pub. #生成的公鑰位置
- 使用記事本打開C:\Users\Administrator\.ssh\id_rsa.pub
- 複制上述檔案中的内容到gitee -->設定 -->ssh公鑰
- 點選确定後,git用戶端輸入ssh -T [email protected],跳出的對話框輸入yes,随後跳出此代碼則設定成功You've successfully authenticated, but GitHub does not provide shell access
- 設定成功後,git用戶端輸入git init
- git add .
- git commit -m "first commit"
- 關聯遠端位址 git remote set-url origin ssh位址
- git push origin master