Git找不到.ssh [英] Git can't find .ssh

查看:405
本文介绍了Git找不到.ssh的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Windows上使用msysgit的问题;它找不到.ssh / id_rsa,即使它存在于应该出现的位置。



我证实这是ssh -v git@github.com的问题;该命令只有在我使用-i选项将其明确指向正确的id_rsa文件时才起作用,但据我所知,git本身没有这样的选项;我无法在Google或提供的文档中找到任何东西。



特别的是,上次我在几个月前使用git时运行良好,并且

我尝试了以下方法,所有这些都不起作用:




  • 生成新的id_rsa

  • 将.ssh放入当前目录 >
  • 将.ssh放入根目录中

  • 卸载msysgit并重新安装最新版本
  • 设置HOME环境变量


  • 安装TortoiseGit并尝试使用它(根本不起作用)

    >



任何想法还有什么可尝试的? / b>发现它!

问题是有两个不同的git命令,git.exe(实际程序)和git.cmd为Windows上的工作提供必要的资料) 。根据您在安装时设置的选项,最终可能会出现前者而不是后者的情况,这种情况最终会在您的路径中结束,因此它不起作用。然后,有关ssh.exe的常见调试建议不起作用,除非您运行git.cmd。



简而言之,确保您正在运行git。 cmd而不是git.exe。


Problem using msysgit on Windows; it can't find .ssh/id_rsa, even though it is present where it should be.

I verified that's the problem with ssh -v git@github.com; that command works when and only when I use the -i option to explicitly point it at the correct id_rsa file but as far as I can tell, git itself doesn't have such an option; and I can't find anything either on Google or in the supplied documentation.

The peculiar thing is, it worked fine last time I used git a few months ago, and I haven't changed anything since then that seems a likely cause.

I've tried the following, all to no effect:

  • Generating new id_rsa

  • Putting .ssh in current directory

  • Putting .ssh in root directory

  • Uninstalling msysgit and reinstalling the latest version

  • Setting the HOME environment variable

  • Installing TortoiseGit and trying that instead (didn't work at all)

Any ideas what else to try?

解决方案

Found it!

The problem is that there are two different git commands, git.exe (the actual program) and git.cmd (which sets up the necessary stuff for it to work on Windows). Depending on what options you set at install time, you can end up with a scenario where the former rather than the latter is the one that ends up in your path, so it doesn't work. Then the usual debugging suggestions regarding ssh.exe don't work unless you've run git.cmd.

In a nutshell, just make sure you're running git.cmd instead of git.exe.

这篇关于Git找不到.ssh的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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