在Github新增一份新的repositories要上傳時跳出密碼輸入
本篇文章將會教學如果設定ssh金鑰,這樣才能夠正常的pull/push 檔案
在本地產生金鑰
$ ssh-keygen -t 4086-C "[email protected]"
Enter file in which to save the key (/c/Users/weixi/.ssh/id_rsa): # 金鑰存放路徑,直接按 Enter
Enter passphrase (empty for no passphrase): # 密碼,可以不輸入
Enter same passphrase again:
Your identification has been saved in /c/Users/weixi/.ssh/id_rsa
Your public key has been saved in /c/Users/weixi/.ssh/id_rsa.pub # 產生密鑰的路徑
將本地金鑰加入git庫
$ ssh-add /c/Users/weixi/.ssh/id_rsa
Identity added: /c/Users/weixi/.ssh/id_rsa (weixi@LAPTOP-CQHOK26F)
將金鑰貼進去剛剛新增的repositories
要記得切換到存放金鑰的目錄 $ cat id_rsa.pub ssh-rsa AAAA............金鑰內容...........weixi@LAPTOP-CQHOK26F
輸入完畢後就完成金鑰設定了。再來就可以將檔案推送到repositories裡面了!