Git CMD : Getting HTTP Basic: Access denied issue when trying to clone the project from GitLab

标签 git gitlab

在尝试从 GitLab 克隆项目时,我收到以下错误:

Cloning into 'project Name'...
remote: HTTP Basic: Access denied
fatal: Authentication failed for 'project GitLab URL'
我们尝试了来自 this 的以下命令线。
git config --system --unset credential.helper
尝试上述命令后,Git CMD 要求输入用户名和密码。我们可以输入用户名,但无法输入密码。
Cloning into 'project Name'...
Username for 'https://gitlab.com': Name
Password for 'https://name@gitlab.com':
remote: HTTP Basic: Access denied
fatal: Authentication failed for 'project GitLab URL'
此外,我们尝试从控制面板中删除 GitLab 条目,例如 this博客。它也没有解决问题。为什么我无法在 GitLab 上输入密码?

最佳答案

评论太长:如描述 here ,你可以

  • 通过 HTTPS 克隆,使用 https://gitlab.com/gitlab-tests/sample-project.git .
  • 或通过 SSH 克隆,使用 git@gitlab.com:gitlab-tests/sample-project.git .

  • 正如认证部分所述,
  • 如果要使用 SSH 进行身份验证,请按照 SSH documentation 上的说明进行操作。在克隆之前进行设置。
  • 如果你想使用 HTTPS,GitLab 会请求你的用户名和密码:
  • 如果您的帐户启用了 2FA,则必须使用 Personal Access Token使用 read_repository 或 write_repository 权限而不是您帐户的密码。在克隆之前创建一个。
  • 如果您没有启用 2FA,请使用您帐户的密码。

  • 关于Git CMD : Getting HTTP Basic: Access denied issue when trying to clone the project from GitLab,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64228498/

    相关文章:

    python - 在 Mountain Lion 服务器上查看文件源时出现 Gitlab 500 错误

    git - 什么时候在 git 中分支?

    Gitlab-CI(在gitlab.com下) "system failure"启动容器进程

    git - Jenkins 与另一个分支 merge 后不会建立分支

    git - 复制上次提交中更改的所有文件

    gitlab - 如何在具有多个服务的存储库中的 Gitlab 中设置 Web API 模糊测试?

    gitlab - 故事书 Gitlab 页面 : script importing from wrong URL resulting in CORS errors

    windows - 在 Windows gitlab runner 的 gitlab-ci 中使用外部 git-lfs 服务器?

    git - 将上游设置为子模块(或如何将 GitHub 分支作为子模块包含在内)

    ruby - Gemfile.lock 总是有未暂存提交的更改