命令:cd ~/.sshgit
命令:ssh-keygen -t rsa -C "youremail@youremail.com"
例如:ssh-keygen -t rsa -C "wanwan5856@163.com"
註解:
Enter file in which to save the key 輸入保存祕鑰的文件 直接enter便可
Enter passphrase (empty for no passphrase) 輸入密碼 直接enter便可
此時查看.ssh目錄下可看到新增的一對祕鑰id_rsa和id_rsa.pub安全
git remote set-url origin 倉庫ssh地址ssh