mac下git安裝和配置,並將gitlab程式碼下載到本地
阿新 • • 發佈:2018-12-03
1、下載git客戶端並安裝,下載地址為:https://git-scm.com/download/mac
2、gitlab賬號申請註冊
3、生成金鑰,並新增到gitlab
(1)配置名字和郵箱:終端輸入
git config --global user.name "xuqiong"
git config --global user.email "[email protected]"
(2)生成金鑰:終端輸入
ssh-keygen -t rsa -C “[email protected]”
按3個回車,完成
最後得到了兩個檔案:id_rsa和id_rsa.pub
在如下目錄找到生成的SSH Key:/users/xuqiong/.ssh/id_rsa.pub
(3)新增金鑰到gitlab
用vim檢視id_rsa.pub檔案內容
並將內容新增到gitlab中:
點選右上角個人頭像---profile--edit--SSH Keys
新增完成後:
4、gitlab下載程式碼
(1)在專案下面複製路徑
(2)終端輸入,進行程式碼下載
git clone [email protected]:qbb-maxcompute/maxcompute.git