git - 尝试对 Azure Devops 执行 git push 时登录失败

标签 git azure-devops azure-active-directory

我在一台 Windows 10 机器上,今天早上我的 git 凭据按预期工作,我正忙着向我们的 Azure Devops 项目推送和 pull 代码。
现在我不能,无论如何从这个特定的虚拟机。当我这样做时 git pull我得到标准的 MS 身份验证提示,并且可以看到我的 MS 帐户(通过我们的联合 AD 连接到 Windows)

enter image description here
我点击我的帐户,提示消失了,我的提示中出现错误:
Logon failed, use ctrl+c to cancel basic credential prompt. Password for 'https://myOrg@dev.azure.com':
如果我输入我的 AD 密码(或其他任何东西),我会收到一条身份验证失败的消息。我还尝试通过在 MS 登录窗口中选择“使用另一个帐户”来重新输入我的凭据,我得到了相同的结果。

我已经看到通过从凭据管理器中删除缓存的凭据解决的问题。所以我去Control Panel -> Credential Manager并删除所有存储的凭据并再次尝试 git 操作。

我得到了相同的 MS 登录窗口,奇怪的是我的帐户仍然存在,并且已连接到 Windows(并且在单击它时以相同的方式失败)

然后我删除了通过 Settings 关联的帐户-> Accounts -> Access work or school .我可以在那里看到我的 MS 帐户,因此看起来很有希望,但行为相同。
我试图更新git(它是v2.21.0.windows.1)
我也安装了微软的git credential manager根据我在 SO 和微软论坛上找到的一些答案。
仍然得到同样的错误。

我重新启动并再次删除了所有凭据/帐户,然后从 Visual Studio 尝试而不是从命令行调用 git。

同样的错误!

我接下来的步骤是重建我的 Windows 配置文件,我希望它可以重置所有这些东西。我能够从另一个 VM 访问该站点,因此它似乎是这台机器上的某种 git 配置/缓存凭据。

任何帮助/想法表示赞赏。

最佳答案

将我的 DevOps 组织移动到不同的租户时,我遇到了这个问题。解决我的问题的唯一方法是删除 tenant.cache来自 GitCredManager 的文件,请参阅:

If you use Visual Studio or the Git command-line tool, you might need to clear the cache for the Git Credential Manager. Deleting the %LocalAppData%\GitCredentialManager\tenant.cache file on each client machine resolves the issue.



来自 https://docs.microsoft.com/en-us/azure/devops/organizations/accounts/connect-organization-to-azure-ad?view=azure-devops

关于git - 尝试对 Azure Devops 执行 git push 时登录失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55406885/

相关文章:

svn - 用于二进制文件的 Git 或 Subversion

Xcode merge : How to click "Left then right" button?

git - 为什么 git (bash) 会在我的新文件中插入一堆废话?

ios - 在 CI 构建中使用 Facebook iOS SDK - 未找到框架

java - 为什么通过刷新 token 获取 Azure AD token 没有签名算法?

azure-active-directory - 未获取刷新 token

Git pull.rebase 这是一个可能有危险的操作

c# - 无法在 Azure DevOps 2019 中通过代码创建代理池(无权限)

Azure 数据工厂展平多数组 JSON - 在数据流源中预览数据时出现问题

asp.net - 使用 Azure Active Directory 进行单点登录