git - 有没有办法在一个命令中使用用户名和密码从 gitlab 克隆?

标签 git bash gitlab git-bash

此帖子中的解决方案不起作用 How to provide username and password when run "git clone git@remote.git"?

git clone https://username:password@github.com/username/repository.git

严重:无法访问“http://..:无法解析主机:用户名”

最佳答案

是的,你可以。语法是:

git clone https://username:token@gitlab.com/user/repo.git

其中 username 是您的 Gitlab 用户名,token 是通过您的 gitlab 的 settings > Access Tokens 生成的

关于git - 有没有办法在一个命令中使用用户名和密码从 gitlab 克隆?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46173962/

相关文章:

git - ssh -vT git@heroku.com 的权限被拒绝(公钥)错误

git - 从 Git 恢复文件?

java - 如何从java后端使用sudo执行shell脚本?

gitlab - 如何设置动态 gitlab-ci 文件

GIT:如何保护分支不被其他开发人员删除?

git - merge 两个github账户

git - 比较 Bitbucket 和 Github 的优缺点

linux - 使用 BASH 从一行中取出最后一个单词并将其添加到开头

bash - 仅从 IP 获取 Mac 地址(bash)

gitlab - 如何防止在GitLab中创建组