mac下git安装和配置,并将gitlab代码下载到本地

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

猜你喜欢

转载自blog.csdn.net/weixin_41770169/article/details/84634408