登录失败,在 Azure DevOps 中使用 ctrl+c 取消对 Git 的基本凭据提示

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/55768926/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-19 13:16:10  来源:igfitidea点击:

Logon failed, use ctrl+c to cancel basic credential prompt to Git in Azure DevOps

gitazure-devops

提问by

When cloning a git repository sitting up in Azure Repos into my local machine clone succeeds but I get a line that says:

将位于 Azure Repos 中的 git 存储库克隆到我的本地机器克隆成功时,但我收到一行内容:

Logon failed, use ctrl+c to cancel basic credential prompt 

Not sure what this is referring to, any ideas?

不确定这是指什么,有什么想法吗?

I'm using PAT token to authenticate my clone, command is:

我正在使用 PAT 令牌来验证我的克隆,命令是:

git clone https://*************PAT*************@dev.azure.com/orgname/projectname/_git/reponame

回答by bk2204

It looks like in this case you actually have two sets of credentials that are in use, and Git has tried one and failed, and fallen back to the other one. This prompt comes up when the credential manager is invoked on Windows in case a prompt is displayed and you need to enter some credentials.

在这种情况下,看起来您实际上有两组正在使用的凭据,Git 尝试了一组但失败了,然后又退回到另一组。在 Windows 上调用凭据管理器时会出现此提示,以防显示提示并且您需要输入一些凭据。

When you put a PAT in the URL like in this case, you need to put the PAT as the password. That means you need to specify a username, so your URL should start with something like https://username:[email protected]/. It isn't clear from your post whether you have the username:portion, so if you don't be sure to add one (it can be anything in this case; tokenand your username are common).

在这种情况下,当您在 URL 中放入 PAT 时,您需要将 PAT 作为密码。这意味着您需要指定一个用户名,因此您的 URL 应该以类似https://username:[email protected]/. 从您的帖子中不清楚您是否有该username:部分,因此如果您不确定添加一个(在这种情况下可以是任何内容;token并且您的用户名很常见)。

If you don't have a URL of that form, your PAT isn't being used, and you're likely falling back to whatever is in your credential manager, which is correct. Otherwise, it's possible that Git is preferring something in your credential manager which isn't correct, and falling back to something that is. Either way, you should inspect the credentials in Windows Credential Manager and delete any that are incorrect.

如果您没有该表单的 URL,则您的 PAT 没有被使用,您可能会退回到凭证管理器中的任何内容,这是正确的。否则,Git 可能更喜欢您的凭证管理器中的某些不正确的东西,然后又退回到正确的东西。无论哪种方式,您都应该检查 Windows 凭据管理器中的凭据并删除任何不正确的凭据。

回答by Rishabh Kumar

Just need to create the credentials from the azure. click on clone->click git credentials-> it will create the user name and password . use this password in jenkins job. It will work

只需要从 azure 创建凭据。单击克隆-> 单击 git 凭据-> 它将创建用户名和密码。在詹金斯工作中使用此密码。它会工作

回答by Manuel Roldan

I think that the problem is that you did not allowed your Agent job to acces the Auth token. Try to check this option for the agent job: enter image description here

我认为问题在于您没有允许您的代理工作访问 Auth 令牌。尝试为代理作业检查此选项: 在此处输入图片说明