git - 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 中登录,并且正在查看其他项目。我该如何解决这个问题?
解决方案
重新安装计算机后,您的本地凭据似乎混合在一起,请按照以下步骤清除 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 存储库做出贡献。项目集合管理员组的成员可以更改访问级别。
推荐阅读
- git - 通过函数在当前分支上查找未推送的提交
- apache - 智能重定向
- git - 无论如何要恢复丢失的 git 提交?
- r - 创建一个 grep 循环来查找字符值,然后在新列中映射匹配项
- rust - 如何编写返回 json 或 html 的简单 warp 处理程序?
- html - 无论兄弟元素如何,如何垂直对齐输入字段以具有相同的宽度?
- mysql - 在 MySQL 中保留索引的同时创建非空表
- arrays - 如何在 Angular 应用程序中显示内部数组的数据和更新值?
- javascript - 在javascript中展开和折叠树
- sql-server - 如何按 DATE 为 SQL Server 中的列中的每个值返回前 3 行?