VS Code:推拉总是要求输入密码
我在 VS Code 中使用 git。我在 Azure DevOps 中有一个项目。 3 个月前,当我复制存储库并推送我的第一个提交时,Git 要求我提供凭据。我输入了用户名并生成了密码。之后一切工作正常。每次我拉或推 VS Code 时都会要求输入密码。我怎样才能保存我的密码?
I'm using git in VS Code. I have a project in Azure DevOps. 3 months ago when I copied repo and pushed my first commit Git asked for my credentials. I entered username and generated password. After that everything was working fine. Starting march every time I pull or push VS Code askes for password. How can I save my password?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
然后 git 会在本地记住你的凭据。该配置也是本地的。
Then git will remember your credential locally. That config is also local.
首先检查您正在使用的 URL:
如果是 HTTPS URL,请检查您正在使用的凭证助手
(例如
manager
或manager-core
),然后检查什么凭证附加到
dev.azure.com
,即远程 URL 的服务器部分:将
xxx
替换为上一步的凭据帮助程序的名称。即使在 Windows CMD 中,只要您的 %PATH% 有 C:\Program Files\Git\usr\bin 和 C:\Program Files\Git\mingw64\libexec\git- core
如果您的凭证未存储,您可以使用 git credential-xxx store 再次注册:
将
替换为您的 DevOps 用户名,然后
带有 Azure PAT(个人访问令牌)。Check first what URL you are using:
If it is an HTTPS URL, check what credential helper you are using
(For instance,
manager
ormanager-core
)Then check what credential is attached to
dev.azure.com
, the server part of your remote URL:Replace
xxx
with the name of the credential helper for the previous step.This work even in a Windows CMD, provided your %PATH% has
C:\Program Files\Git\usr\bin
andC:\Program Files\Git\mingw64\libexec\git-core
If your credential is not stored, you can register it again with
git credential-xxx store
:Replace
<you>
with your DevOps username, and<token>
with an Azure PAT (Personal Access token).