gpt4 book ai didi

version-control - Mercurial Keyring 每次都提示输入密码

转载 作者:行者123 更新时间:2023-12-04 07:11:56 24 4
gpt4 key购买 nike

我正在使用 mercurial key-ring extension将密码存储到我在 BitBucket 上的远程存储库中,因此我不必每次推送到远程存储库时都输入它。具有讽刺意味的是,每次我需要访问它时,它都会要求我输入密码来解锁 key 圈;从而完全减轻了它对我的目的。我究竟做错了什么?

在我的全局 mercurial 配置(~/.hgrc)中,我有以下几行:

[extensions]
hgext.mercurial_keyring = /etc/mercurial/mercurial_keyring.py

在我的 repo mercurial 配置 (.hg/hgrc) 中,我有:
[paths]
default = https://username@bitbucket.org/username/repo

例子:
> hg out
> comparing with https://username@bitbucket.org/username/repo
> Please enter password for encrypted keyring:

我试过卸载 key 圈并重试。我也玩过我在网上找到的配置设置无济于事。我也找不到有关 mercurial 的加密 key 环和非加密 key 环的任何内容。

如何获取它以便在对远程存储库执行操作时根本不必输入密码?

最佳答案

不知道问这个问题的时候是不是已经这样了,但是现在直接在keyring extension wiki link in your question中说明了解决方法。 .

仅仅启用 key 环扩展是不够的,您还需要在配置文件中告诉 Mercurial 远程仓库和用户名。

引自链接:

3.2. Repository configuration (HTTP)

Edit repository-local .hg/hgrc and save there the remote repository path and the username, but do not save the password. For example:

[paths] 
myremote = https://my.server.com/hgrepo/someproject

[auth]
myremote.schemes = http https
myremote.prefix = my.server.com/hgrepo
myremote.username = mekk

Simpler form with url-embedded name can also be used:

[paths]
bitbucket = https://User@bitbucket.org/User/project_name/

Note: if both the username and password are given in .hg/hgrc, the extension will use them without using the password database. If the username is not given, extension will prompt for credentials every time, also without saving the password. So, in both cases, it is effectively reverting to the default behaviour.



请注意,您不需要指定这些示例中显示的所有信息。

在我的机器上(Windows 上的 Mercurial 5.0.2),我使用了一个更简单的表单,它也适用于多个存储库。
这是来自我的实际配置文件的 1:1 副本:
[extensions]
mercurial_keyring =

[auth]
bb.prefix = https://bitbucket.org/
bb.username = christianspecht

这使用 key 环扩展来保存用户的密码 christianspecht , 对于 URL 以 https://bitbucket.org/ 开头的所有远程存储库.

前缀 bb可以自由选择,因此您可以使用它一次保存多个 URL/用户名。

这非常有效(至少在 Bitbucket 在几周内放弃 Mercurial 支持之前......) - 它要求输入一次密码,然后它会自动保存并且不再询问。

关于version-control - Mercurial Keyring 每次都提示输入密码,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27533475/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com