简体   繁体   English

Git致命:远程端挂了

[英]Git fatal: remote end hung up

So I thought I had finally got everything setup on Windows ... then ran into this issue. 所以我以为我终于在Windows上安装了所有东西......然后遇到了这个问题。

Current setup 当前设置

URL: ssh://user@host:port/myapp.git URL:ssh:// user @ host:port / myapp.git

Already run Putty - and can connect using valid .ppk keys through the ~/.ssh/authorized_keys direct. 已经运行了Putty - 并且可以通过〜/ .ssh / authorized_keys直接使用有效的.ppk密钥进行连接。 In Git and TortoiseGIT - I set both to use "plink.exe". 在Git和TortoiseGIT中 - 我将两者都设置为使用“plink.exe”。

Putty works fine - no issues - but when I run that URL into bash I get for a git clone (url) Putty工作正常 - 没有问题 - 但是当我将该URL运行到bash时,我得到了一个git clone(url)

fatal: the remote end hung up expectedly 致命的:远程端预计会挂断

In a cygwin bash terminal - running "ssh user@host" - works no probs at all. 在一个cygwin bash终端 - 运行“ssh user @ host” - 根本不工作。

Anyone suggest anything? 有人建议吗?

I found out that using ssh.exe from the Git package works every time, as opposed to the ssh that comes with cygwin (the default). 我发现每次都使用Git包中的ssh.exe,而不是cygwin附带的ssh(默认)。 Using this exported variable seems to help; 使用这个导出的变量似乎有所帮助; it's slower (2x or more) but it's more stable. 它更慢(2倍或更多),但它更稳定。 Take it as another workaround. 把它作为另一种解决方法。

$ export GIT_SSH=/cygdrive/c/Program\\ Files/Git/bin/ssh.exe $ export GIT_SSH = / cygdrive / c / Program \\ Files / Git / bin / ssh.exe

FYI: This version of Msysgit comes with OpenSSH 4.6p1, OpenSSL 0.9.8e. 仅供参考:这个版本的Msysgit附带OpenSSH 4.6p1,OpenSSL 0.9.8e。 [works] Cygwin's SSH is OpenSSH 5.5p1, OpenSSL 0.9.8n. [作品] Cygwin的SSH是OpenSSH 5.5p1,OpenSSL 0.9.8n。 [doesn't work] [不起作用]

I had the same problem with plink for git under windows. 我在windows下使用glink的glink也有同样的问题。

On run of plink.exe -v xxx@host.com it started to show Pageant is running. 在运行plink.exe -v xxx@host.com时,它开始显示Pageant正在运行。 Requesting keys. 请求密钥。 Pageant has 1 SSH-2 keys login as: <<< trouble Pageant有1个SSH-2密钥登录为:<<<麻烦

Instead of Pageant is running. 而不是Pageant正在运行。 Requesting keys. 请求密钥。 Pageant has 1 SSH-2 keys Using user "xxx" Pageant有1个SSH-2密钥使用用户“xxx”

To resolve this problem I cleaned up the putty registry records and sessions by putty.exe -cleanup 为解决此问题,我通过putty.exe -cleanup清理了putty注册表记录和会话

After that plink starts afresh and asks to trust and store the host again and it is getting connected with no problem ! 之后plink重新开始并要求信任并再次存储主机,它正在连接没有问题!

Try following steps, maybe something will give you a hint on your problem: 尝试以下步骤,也许某些事情会给你一个问题提示:
1. Run putty and after setting up server name/user name/keys etc. save those settings. 1.运行putty并在设置服务器名称/用户名/密钥等后保存这些设置。
2. Run plink.exe or plinkw.exe like plink.exe user_name@server , (it'll throw some info at you) just to see if plink can connect to the server. 2.运行plink.exe或plinkw.exe,如plink.exe user_name @ server ,(它会向您发送一些信息),看看plink是否可以连接到服务器。
3. Check again that git knows that it should use plink, I'd say with all VCSs, that's the problem people have most often, apart from their keys not being set up properly. 3. 再次检查git知道它应该使用plink,我会说所有VCS,这是人们最常遇到的问题,除了他们的密钥没有正确设置。
Normally by now most of your ssh problems would be revealed. 通常到现在为止,你的大多数ssh问题都会被揭露出来。 Now just fix them. 现在只需修复它们。 :) :)

Update: 更新:

I think the problem you have is caused by several gits you've got installed. 我认为你遇到的问题是由你安装的几个 gits引起的。 For the msysgit and cygwin git you'd need to set the GIT_SSH variable. 对于msysgit和cygwin git,您需要设置GIT_SSH变量。 That's done via either 'set GIT_SSH=c:\\path\\putty\\plink.exe' or 'export GIT_SSH=/your/path/putty/putty.exe' respectively. 这是通过'set GIT_SSH = c:\\ path \\ putty \\ plink.exe'或'export GIT_SSH = / your / path / putty / putty.exe'分别完成的。 If you're also using tortoise git, you'd need to locate 'properties' (or is it settings?) in it's menu, and set the ssh client there. 如果你也在使用togise git,你需要在它的菜单中找到'properties'(或者它是设置?),然后在那里设置ssh客户端。
Apart from all that, when specifying git clone URL, use your login name and the server name in there, eg 'git clone ssh://user@server/your/path/repo.git User and server names should be used by plink, and plink should be able to connect to the server with those arguments, when all of those requirements are met, you'll be all set. 除此之外,在指定git clone URL时,请使用您的登录名和服务器名称,例如'git clone ssh://user@server/your/path/repo.git plink应使用用户名和服务器名,并且plink应该能够使用这些参数连接到服务器,当满足所有这些要求时,您将全部设置。

Good luck. 祝好运。

If you want to try the cygwin openssh 5.4p1-1, which does seem to work for this, unlike 5.5 or 5.6, you can use the cygwin time machine mirrors. 如果您想尝试cygwin openssh 5.4p1-1,这似乎对此有用,与5.5或5.6不同,您可以使用cygwin时间机器镜像。 Start setup.exe with -X and add a mirror Url, such as: 使用-X启动setup.exe并添加镜像URL,例如:

ftp://www.fruitbat.org/pub/cygwin/circa/2010/05/20/230133

Be careful not to install too much, ie base packages, from an older mirror than the rest of your install. 小心不要从旧镜像安装太多(即基础包),而不是安装其余部分。

We had same problem and here is solution how we solved the problem: 我们有同样的问题,这里是解决问题的方法:

at first we got: 起初我们得到了:

zajdan@cyberFuture:~$ git clone ssh://nette@19X.16X.14X.7X/~repos/erotika.git/ erotika
Initialized empty Git repository in /home/zajdan/erotika/.git/
Password: 
fatal: '/repos/erotika.git': unable to chdir or not a git archive
fatal: The remote end hung up unexpectedly
zajdan@cyberFuture:~$ 

solution: 解:

zajdan@cyberFuture:~$ git clone ssh://nette@19X.16X.14X.7X/~/repos/erotika.git/ erotika

after tilde there must be a slash ! 在波浪之后必须有一个斜线

I have exactly the same issue. 我有完全相同的问题。

I don't use Putty (just Cygwin). 我不使用Putty(只是Cygwin)。 I use Windows 7 Ultimate (fully patched as of this moment). 我使用Windows 7旗舰版(此刻完全打补丁)。 I just installed Cygwin yesterday. 我昨天刚刚安装了Cygwin。

I made sure binary mounts were being used. 我确保使用二进制坐骑。

If I copy a git repo to the machine (via samba mount), I can clone it, but when I "git diff" after the clone, there are a bunch of "different" files with no diffs. 如果我将一个git repo复制到机器上(通过samba mount),我可以克隆它,但是当我在克隆之后“git diff”时,有一堆“不同”的文件没有差异。 After a "git status" there was no output from "git diff". 在“git status”之后,没有“git diff”的输出。 It seems like a newline thing, but I can't figure out how that would be happening. 这似乎是一个新行,但我无法弄清楚会发生什么。 (I have igncr in SHELLOPTS, but removing that doesn't fix it.) (我在SHELLOPTS中点燃了,但删除它并不能解决它。)

I'm completely stumped. 我完全难过了。

Check the openssh version you're using in CygWin. 检查您在CygWin中使用的openssh版本。 Version 5.5p1-1 (which is the latest at this time) gave me the same error. 版本5.5p1-1(这是当时的最新版本)给了我同样的错误。 Downgrading to 5.4p1-1 fixed the problem. 降级到5.4p1-1解决了这个问题。

Another solution would be to use putty/plink instead of openssh. 另一个解决方案是使用putty / plink而不是openssh。

For more details, see this thread: http://www.mail-archive.com/cygwin@cygwin.com/msg103752.html 有关更多详细信息,请参阅此主题: http//www.mail-archive.com/cygwin@cygwin.com/msg103752.html

I get message: "remote end gung-up, unexpected EOFs, index-pack failed" while cloning git repo but was able to workaround this issue with copssh http://sourceforge.net/projects/sereds/files/Copssh 我收到消息:“远程结束,意外的EOF,索引包失败”,同时克隆git repo但能够解决这个问题与copssh http://sourceforge.net/projects/sereds/files/Copssh

The root cause is Cygwin openssh package. 根本原因是Cygwin openssh包。

I removed original openssh from Cygwin, installed copssh and set GIT_SSH variable to point copssh binaries. 我从Cygwin中删除了原始openssh,安装了copssh并将GIT_SSH变量设置为指向copssh二进制文件。 After this I simply added copssh binaries in the PATH and now I'm using copssh instead of openssh - there is no difference. 在此之后我只是在PATH中添加了copssh二进制文件,现在我使用的是copssh而不是openssh - 没有区别。

Everything works fine and issue does not appear any more. 一切正常,问题不再出现。

The other solution is to use mSysGit package. 另一种解决方案是使用mSysGit包。

I believe the real problem is that cygwin's ssh looks for .ssh in /home/ name /.ssh and mingw's git ssh looks for .ssh in c:/user/ name /.ssh 我相信真正的问题是cygwin的ssh在/ home / name /.ssh中查找.ssh而mingw的git ssh在c:/ user / name /.ssh中查找.ssh

Chances are your keys are in one and only one of these directories. 有可能你的钥匙只在其中一个目录中。

You can trying telling cygwin's .ssh to use a different identity file using the -i switch, or move the keys into both directories, or create an ssh config file in /home/ name /.ssh/config. 你可以尝试告诉cygwin的.ssh使用-i开关使用不同的身份文件,或者将密钥移动到两个目录中,或者在/ home / name /.ssh/config中创建一个ssh配置文件。

I created a config that contains: 我创建了一个配置包含:

Host github.com
    User jerryasher
    Hostname github.com
    IdentityFile c:/Users/jerry/.ssh/id_rsa

And given that I can use either the mingw git from git bash or cygwin's git from an rxvt to interact with github. 鉴于我可以使用来自git bash的mingw git或来自rxvt的cygwin的git来与github进行交互。

To correct this issue, run "plink -agent github.com" Press y when prompted to cache the key. 要解决此问题,请运行“plink -agent github.com”在提示缓存密钥时按y键。 Login as git. 以git身份登录。 You'll automatically be disconnected. 您将自动断开连接。 And it sould work. 它可以工作。

Source: http://devlicio.us/blogs/sergio_pereira/archive/2009/05/06/git-ssh-putty-github-unfuddle-the-kitchen-sink.aspx 资料来源: http//devlicio.us/blogs/sergio_pereira/archive/2009/05/06/git-ssh-putty-github-unfuddle-the-kitchen-sink.aspx

Try to use absolute path to repo in a URL, that worked for me. 尝试在URL中使用绝对路径来回购,这对我有用。

Instead of: 代替:

git ssh://user@host:port/myapp.git

Write: 写:

git ssh://user@host:port//home/user/repo/myapp.git

Notice the double slash! 注意双斜线!

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

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