【发布时间】:2021-11-14 23:34:27
【问题描述】:
我试图从我可以访问的私有存储库中推送/拉取代码,但我得到了以下错误:
remote: Repository not found.
fatal: Authentication failed for 'https://github.com/path-togit.git/'
我已经搜索并尝试了不同平台上提供的所有解决方案,但没有一个有效。比如删除密码和密钥中的vscodegithub项,还是不行。
我尝试了以下方法,但它们在我的情况下不起作用:
- Error pushing to Git remote with HTTP #1138
- Changing the Git user inside Visual Studio Code
- How can I remove a GitHub password from Visual Studio Code?
我看到报告这些成功的人是 Windows 和 Mac 用户。有适用于 Ubuntu 的解决方案吗?
P.S.:我可以使用普通终端成功推/拉。我的问题在于 Visual Studio Code 终端,而我的操作系统是 Ubuntu 20.04(Focal Fossa)。
【问题讨论】:
-
你的
git config credential.helper是什么? -
@VonC 最初运行该命令没有返回响应然后在尝试解决方案的某个地方我将缓存超时更改为 1 秒,所以现在当我运行
git config credential.helper时我得到cache --timeout=1 -
你的
git version是什么?远程 URL 是否存在? (如果你输入那个确切的 URL,你会进入你的 provaye 存储库吗?) -
@VonC git version
git version 2.31.1并且是远程 URL 存在。如问题中所述,我可以使用普通终端拉或推。但我不能在 vs code 中使用终端。当我切换存储库时,VS 代码一定缓存了错误的密码,我希望它忘记这些凭据,以便我可以输入新的密码 -
好的。 VSCode 应该使用与命令行相同的凭据帮助程序。我会安装 GCM-core (github.com/microsoft/Git-Credential-Manager-Core/#linux),看看缓存是否更适合 VSCode。
标签: git github visual-studio-code