ssh的配置
1.打開本地git bash,使用如下命令生成ssh公鑰和私鑰對
ssh-keygen -t rsa -C 'xxx@xxx.com' 然后一路回車(-C 參數(shù)是你的郵箱地址)
2.然后會出現(xiàn):Enter file in which to save the key (/Users/yzq/.ssh/id_rsa):
繼續(xù)回車
3.如果你的.ssh/id_rsa已經(jīng)旗唁,則會出現(xiàn):/Users/yzq/.ssh/id_rsa already exists.
Overwrite (y/n)? y
輸入:y (重新覆蓋)
輸入:n (不覆蓋
4.設(shè)置你的密碼
5.現(xiàn)在只需要查看本機(jī)ssh公鑰,獲取得到它
cd ~/.ssh
open .
打開 id_rsa.pub文件吹艇,全部復(fù)制
6.打開gitlab,找到Profile Settings-->SSH Keys--->Add SSH Key,并把上一步中復(fù)制的內(nèi)容粘貼到Key所對應(yīng)的文本框