Git凭证管理器和手动创建的PAT [英] Git credential manager and manually created PAT

查看:107
本文介绍了Git凭证管理器和手动创建的PAT的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我必须在客户拥有的计算机上工作.我们的工作代码是在Azure Dev Ops存储库下管理的,我使用我的个人Microsoft帐户登录.

I have to work from computers owned by customer. Our work's code is managed under a Azure Dev Ops repository, where I log in using my personal Microsoft Account.

为了降低风险,我在Azure Devops仪表板中创建了一个权限最少的个人帐户.

In order to reduce risk, I created a personal account with minimal rights within my Azure Devops dashboard.

如何在不提示我的Microsoft帐户的情况下将git设置为使用此PAT?

How can I setup git to use this PAT without prompting for my Microsoft Account ?

现在,每次触发远程操作时,都会打开一个模式,询问用户名/密码.如果我关闭它,它将重新打开.我再次关闭,可以输入我的PAT.这正在工作.

Right now, each time a remote operation is triggered, a modal opens, asking for username/password. If I close it, it reopens. I close again and I can enter my PAT. This is working.

但是,如果我触发新的远程操作,则会发生相同的序列(必须关闭两次凭据对话框,然后粘贴PAT).

But if I trigger a new remote operation, same sequences occurs (have to close twice the credential dialog, then pasting the PAT).

如何确定存储PAT?

仅供参考,我已经确保在git global config中设置了正确的帮助程序,如

FYI, I've ensure the correct helper is set within git global config, as suggested by the FAQ : git config credential.helper manager

我还尝试使用 git config --system --unset credential.helper 禁用凭据帮助程序,但是问题仍然存在.

I also tried to disable the credential helper with git config --system --unset credential.helper, but the issue is still present.

另一种尝试是使用另一个帮助程序: git config credential.helper store .不太好

Another try was to use another helper : git config credential.helper store. Not better

仅供参考:我正在Windows 2012R2上运行,具有最新的git版本( git version 2.20.1.windows.1 )

FYI: I'm running on windows 2012R2, with the latest git version (git version 2.20.1.windows.1)

推荐答案

编辑全局git配置并将帮助程序留空.

Edit your global git config and leave the helper empty.

 [credential]
      helper=

然后从Windows凭据存储中删除您的凭据.

Then delete your credential from the Windows Credential store.

那应该关闭凭据助手,并恢复为默认的git行为.

That should turn off the credential helper and revert to the default git behavior.

这篇关于Git凭证管理器和手动创建的PAT的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆