Skip to main content

在gitlab上使用access token拉取代码

1.1 Gitlab Token

在 gitlab 上 申请 Token

个人 settings -> access tokens -> 勾选 read_repository

然后点 Create personal access token

1.2 git clone

git clone https://oauth2:[email protected]/vendor/package.git

clone下来后已经设置了remote url,可以pull,但不能push

在CI/CD环节够使用

参见: using-gitlab-token-to-clone-without-authentication