首页 > 解决方案 > Visual Studio - Azure Dev:未能将分支推送到远程存储库

问题描述

我正在使用 VS2019 和 Azure DevOps。我根本不是源代码控制方面的专家,我只使用 Azure Devops 作为我的项目的备份。

我最近不得不重新安装我的电脑并开始一个新项目。但是在尝试推送到 Azure DevOps 时,我收到以下错误:

Failed to push the branch to the remote repository. See the Output window for more details.

Pushing master

Error encountered while pushing branch to the remote repository: Git failed with a fatal error. unable to update url base from redirection: asked for: https://dev.azure.com/...../info/refs?service=git-receive-pack redirect: https://spsprodweu4.vssps.visualstudio.com/_signin?

我似乎被重定向到登录页面。但我已在 Visual Studio 中登录,并且正在查看其他项目。我该如何解决这个问题?

标签: gitvisual-studioazure-devops

解决方案


重新安装计算机后,您的本地凭据似乎混合在一起,请按照以下步骤清除 Visual Studio 2017 中存储的 TFS 凭据和 Git 凭据。

  • 关闭所有 Visual Studio 实例,删除%LOCALAPPDATA%\.IdentityService.
  • 清除 TFS 缓存%LOCALAPPDATA%\Microsoft\Team Foundation\7.0\Cache
  • 清除所有浏览器缓存,尤其是存储的密码
  • 查看Windows 凭据管理器并在那里删除与 TFS 相关的凭据和 Git 凭据 在此处输入图像描述
  • 重新启动Visual Studio > Team Explorer > Manage Connections以检查是否Enter credential dialog弹出。只需尝试几次或重新启动 VS 以再次弹出它。
  • 输入用户密码,然后Team Explorer > Manage Connections以连接到目标项目。有关更多详细信息,请参阅此线程

此外,您可以关注此文档:从 Visual Studio 或团队资源管理器连接以获得更多指导。

更新 如果您的访问级别是此组织中的利益相关者,则您无法为 Azure 存储库做出贡献。项目集合管理员组的成员可以更改访问级别。


推荐阅读