一、檢查本機(jī)是否有SSH Key
1. windows命令行
? ? ? ? type ?%userprofile%\.ssh\id_rsa.pub
其中%userprofile%為你的用戶(hù)文檔目錄,即用戶(hù)目錄,例如:C:\Users\mycompute.
2. git bash/Linux/Mac
? ? ? ? cat ~/.ssh/id_rsa.pub
如果有SSH Key,并且Key值正是對(duì)應(yīng)你當(dāng)前的工程,可以不再生成,直接使用到git上,否則看下面。
二、生成SSH Key
? ? ? ? ssh-keygen -t rsa -C"email"
其中email為你注冊(cè)git的郵箱名。
三、獲取SSH Key
? ? ? ? 參考步驟一,即為獲取SSH Key的方法