【问题标题】:Visual Studio - Remote: HTTP Basic: Access denied Error encountered while cloning the remote repository: Git failed with a fatal errorVisual Studio - 远程:HTTP Basic:访问被拒绝 克隆远程存储库时遇到错误:Git 失败并出现致命错误
【发布时间】:2018-11-02 09:41:59
【问题描述】:

我正在使用 Visual Studio,并试图从运行 gitlab 的服务器克隆在线存储库。让我们调用服务器https://gitlab.example.com

当我尝试克隆 repo 时出现以下错误

Remote: HTTP Basic: Access denied
Error encountered while cloning the remote repository: Git failed with a fatal error.
Authentication failed for 'https://gitlab.example.com/username/test.git/'

当我尝试时,系统会提示我输入服务器的用户名和密码。我输入了创建 repo 的用户的用户凭据。

我在 stackoverflow 上找到了 similar problem with an answer,但这对我不起作用。

我正在使用 Visual Studio 2017 Enterprise 15.7.2

【问题讨论】:

标签: git visual-studio gitlab git-clone


【解决方案1】:

Windows 必须已保存需要更新/删除的 git 凭据。以下步骤在 VS2017 中对我有用。

从 Windows“开始”转到“凭据管理器”,然后在“通用凭据”下选择您的 git url。单击右侧箭头,它应该会展开,您应该会看到两个链接“编辑”和“从保管库中删除”。

单击后一个链接(推荐),重新启动 VS,打开您的项目并执行同步/拉取请求,它应该要求您输入凭据,您应该一切顺利。谢谢

【讨论】:

  • 这让我注意到我的密码没有正确保存。
【解决方案2】:

您需要在您的 url 中提供 Gitlab 用户名和密码。

所以,而不是

https://gitlab.com/username/test.git/

使用这个网址

https://YOUR_GITLAB_USERNAME:PASSWORD@gitlab.com/username/test.git/

【讨论】:

    猜你喜欢
    • 2020-12-09
    • 2020-01-29
    • 2022-07-15
    • 1970-01-01
    • 2014-02-10
    • 2013-11-28
    • 1970-01-01
    • 1970-01-01
    • 2016-03-19
    相关资源
    最近更新 更多