使用 GitLab 令牌无需身份验证即可克隆 [英] Using GitLab token to clone without authentication

查看:13
本文介绍了使用 GitLab 令牌无需身份验证即可克隆的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在不提示我的自动化脚本的情况下克隆 GitLab 存储库,方法是使用我的 GitLab 帐户中的私人令牌.

I want to clone GitLab repository without prompt for my automation script, by using my private token from my GitLab account.

谁能给我一个样品?

我知道我可以使用用户名和密码:

I know I can do so with user and password:

git clone https://" + user + ":" + password + "@" + gitlaburl;

我知道可以使用 ssh 密钥

and I know it is possible with ssh key

但是,这两个选项都不够.

But, both options are insufficient.

推荐答案

我知道这是旧的,但你是这样做的:

I know this is old but this is how you do it:

git clone https://oauth2:ACCESS_TOKEN@somegitlab.com/vendor/package.git

这篇关于使用 GitLab 令牌无需身份验证即可克隆的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆