cengwendeMacBook-Pro:~ cengwen$ cd .ssh? ? ??
cengwendeMacBook-Pro:.ssh cengwen$ ls
id_rsa id_rsa.pub known_hosts? ? ? ?查看 .ssh文件夾是否包含id_rsa? id_rsa.pub?
?ssh-keygen -t rsa -C "your email"? //這個(gè)是生成 id_rsa? id_rsa.pub? ?文件??
cengwendeMacBook-Pro:.ssh cengwen$ ssh-keygen -t rsa -C "1062508262@qq.com"?
cengwendeMacBook-Pro:.ssh cengwen$ cat id_rsa.pub? ?
如果 你的?id_rsa? id_rsa.pub文件是gitlab的郵箱生成的。cat id_rsa.pub? ?拷貝公鑰 到gitlab。添加 ssh key? ?就可以了速缨。然后就可以用sourceTree 下載代碼了
如果你的.ssh 文件沒有??id_rsa? id_rsa.pub? 或者不是你gitlab郵箱生成的吸祟。
做了這一步。就生成了私鑰和公鑰肋僧。
cengwendeMacBook-Pro:.ssh cengwen$ cat id_rsa.pub? ? 查看公鑰抑淫,拷貝到gitlab,
然后就可以用sourceTree 下載代碼了