首页
学习
活动
专区
工具
TVP
发布
社区首页 >问答首页 >Git克隆/拉取持续冻结在“在缓存中存储密钥?”

Git克隆/拉取持续冻结在“在缓存中存储密钥?”
EN

Stack Overflow用户
提问于 2015-10-20 23:02:18
回答 6查看 53.9K关注 0票数 191

我正在尝试从我的BitBucket账户克隆一个repo到我的Windows10笔记本电脑(运行GitBash)。我已经完成了连接所需的所有步骤(设置我的SSH密钥,由successfully git@bitbucket.org验证,等等)。但是,每当我尝试克隆存储库时,在确认我想要缓存Bitbucket的密钥后,提示符会持续挂起。

代码语言:javascript
复制
User@Laptop MINGW64 /C/Repos
$ git clone git@bitbucket.org:mygbid/test.git
Cloning into 'test'...
The server's host key is not cached in the registry. You
have no guarantee that the server is the computer you
think it is.
The server's rsa2 key fingerprint is:
ssh-rsa 2048 97:8c:1b:f2:6f:14:6b:5c:3b:ec:aa:46:46:74:7c:40
If you trust this host, enter "y" to add the key to
PuTTY's cache and carry on connecting.
If you want to carry on connecting just once, without
adding the key to the cache, enter "n".
If you do not trust this host, press Return to abandon the
connection.
Store key in cache? (y/n) y

没有克隆任何文件,结果是一个空的存储库。尝试从该存储库启动git拉取原始主机时,也会要求缓存密钥,然后挂起,没有任何反馈。尽管我在进行SSH测试时没有要求缓存密钥,但每次git操作都会在失败之前请求密钥。

由于没有要处理的错误消息,我真的不知道哪里出了问题。我已经尝试了多个repos,包括非常小的一个,但都没有成功。

EN

回答 6

Stack Overflow用户

回答已采纳

发布于 2015-10-22 23:59:38

在Windows 10上克隆存储库时,我也遇到了这个问题。

我使用Putty GUI通过SSH连接到有问题的服务器(在您的例子中是: bitbucket.org),然后在系统提示您是否要将服务器密钥保存到缓存时单击'Yes‘来解决这个问题。再次运行克隆命令,然后对我起作用了!

票数 223
EN

Stack Overflow用户

发布于 2018-10-23 10:39:45

我设法通过直接运行plink来让它工作,在pageant运行之后直接使用plink命令- plink.exe -agent -v git@github.com然后这个git工作而不会挂起。

票数 38
EN

Stack Overflow用户

发布于 2016-05-27 20:04:02

要在powershell中执行此操作,请打开powershell窗口并粘贴以下内容:

代码语言:javascript
复制
echo y | & 'C:\Program Files (x86)\GitExtensions\PuTTY\plink.exe' -ssh git@github.com
echo y | & 'C:\Program Files (x86)\GitExtensions\PuTTY\plink.exe' -ssh git@gist.github.com
echo y | & 'C:\Program Files (x86)\GitExtensions\PuTTY\plink.exe' -ssh git@bitbucket.org

或者使用PuTTY独立版本:

代码语言:javascript
复制
echo y | & 'C:\Program Files (x86)\PuTTY\plink.exe' -ssh git@github.com
echo y | & 'C:\Program Files (x86)\PuTTY\plink.exe' -ssh git@gist.github.com
echo y | & 'C:\Program Files (x86)\PuTTY\plink.exe' -ssh git@bitbucket.org

同样值得一提的是putty stores known hosts under a registry key

代码语言:javascript
复制
HKEY_CURRENT_USER\SoftWare\SimonTatham\PuTTY\SshHostKeys

要简化上述操作,您可以将以下代码放在.reg文件中并运行:

代码语言:javascript
复制
Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\SOFTWARE\SimonTatham\PuTTY\SshHostKeys]
"rsa2@22:github.com"="0x23,0xab603b8511a67679bdb540db3bd2034b004ae936d06be3d760f08fcbaadb4eb4edc3b3c791c70aae9a74c95869e4774421c2abea92e554305f38b5fd414b3208e574c337e320936518462c7652c98b31e16e7da6523bd200742a6444d83fcd5e1732d03673c7b7811555487b55f0c4494f3829ece60f94255a95cb9af537d7fc8c7fe49ef318474ef2920992052265b0a06ea66d4a167fd9f3a48a1a4a307ec1eaaa5149a969a6ac5d56a5ef627e517d81fb644f5b745c4f478ecd082a9492f744aad326f76c8c4dc9100bc6ab79461d2657cb6f06dec92e6b64a6562ff0e32084ea06ce0ea9d35a583bfb00bad38c9d19703c549892e5aa78dc95e250514069"
"rsa2@22:gist.github.com"="0x23,0xab603b8511a67679bdb540db3bd2034b004ae936d06be3d760f08fcbaadb4eb4edc3b3c791c70aae9a74c95869e4774421c2abea92e554305f38b5fd414b3208e574c337e320936518462c7652c98b31e16e7da6523bd200742a6444d83fcd5e1732d03673c7b7811555487b55f0c4494f3829ece60f94255a95cb9af537d7fc8c7fe49ef318474ef2920992052265b0a06ea66d4a167fd9f3a48a1a4a307ec1eaaa5149a969a6ac5d56a5ef627e517d81fb644f5b745c4f478ecd082a9492f744aad326f76c8c4dc9100bc6ab79461d2657cb6f06dec92e6b64a6562ff0e32084ea06ce0ea9d35a583bfb00bad38c9d19703c549892e5aa78dc95e250514069"
"rsa2@22:bitbucket.org"="0x23,0xb9b88df3578371a7eb80c78bcda14fb30da436f11ca932a5fd5a8b6adfcc681df7a59cb4cb7ac966d9eac11daa38ebdbc0a6582a210ed4ee95a8d101c4abc925e942ab47535d64f9a5b3b68035c2ea1e900d709a1e8ea938718f532f9805a190446b92bac3040126225ae9d8374bc2008f106979d631734c7453f78c70091f4783b288869cb3c1941a784cd9baad823be27333833dc1f488a45b85952be75cf0a64965662302e3915378dcd5cfcd3ec903d804a29dff2fdf19df5deba4534b09e4dea6e44f152e339b3c43be98ddadfc56533192e216a3d673f00b4aa9cc9e7870acd8b6adb7e0feb77f2292fc2dede94819def3eb1e785541a06ab31ccf725f"

putty-hosts.reg gist

票数 30
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/33240137

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档