简体   繁体   English

如何在Windows上使用Mercurial使用SSH密钥进行推/拉?

[英]How to make Mercurial on Windows use an SSH key for push/pull?

如何告诉TortoiseHg(或一般Mercurial)我想在推/拉远程存储库时使用给定的SSH密钥?

On Windows, see Accessing SSH-controlled repositories from a Windows client : you need PuTTY, plink and a particular config setting. 在Windows上,请参阅从Windows客户端访问SSH控制的存储库 :您需要PuTTY,plink和特定的配置设置。

To put that in a particular repository, put in .hg/hgrc 要将它放在特定的存储库中,请输入.hg/hgrc

[ui]
ssh="C:\path to\plink.exe" -ssh -i "C:\your path to\private.key"

Also note that you don't need to specify the key path if you use pageant. 另请注意,如果使用选美,则无需指定密钥路径。

You need to use PuTTY, set up a profile in that for the connection to the remote repository. 您需要使用PuTTY,在其中设置配置文件以连接到远程存储库。 and then in TortoiseHg you can then connect to ssh://profilename/ 然后在TortoiseHg中,您可以连接到ssh:// profilename /

eg I set one up for bitbucket and called it bitb, so the connection is ssh://bitb/url-to-repo. 例如,我为bitbucket设置了一个并将其命名为bitb,因此连接是ssh:// bitb / url-to-repo。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM