[英]Git remote end hung up unexpectedly
I am trying to set up a git repo on my test server when I try to push from my windows computer 当我尝试从我的Windows计算机上推送时,我正试图在我的测试服务器上设置一个git repo
git push ssh://git@server.com:/path/.git
I get the error 我收到了错误
fatal: The remote end hung up unexpectedly
But when I ssh'd into my server and tried to do the the exact same command it worked just fine. 但是,当我进入我的服务器并尝试执行完全相同的命令时,它工作得很好。 Is this a problem with my git setup or with my windows setup 这是我的git设置或我的Windows设置的问题
The problem might be caused by a number of issues: 问题可能是由许多问题引起的:
git
uses SSH to spawn remote git
instance it still spawns the default (for the user) shell on the server. 这是因为在这些情况下Unix shell会读取不同的启动文件,当git
使用SSH生成远程git
实例时,它仍会生成服务器上的默认shell(对于用户而言)。 plink.exe
to access the server, and it asks you to accept the host's key by entering "y" or "n" (which you can't do). 你有一个本地问题(比如,你配置Git使用plink.exe
访问服务器,它要求你输入“y”或“n”(你不能这样做)接受主机的密钥。 In any case, try these steps: 无论如何,请尝试以下步骤:
plink.exe git@server.com "git --version"
and see it's able to run Git on the server at all. 运行plink.exe git@server.com "git --version"
,看看它能够在服务器上运行Git。 If you don't use plink.exe
use whatever binary is shipped with OpenSSH included with Git for Windows; 如果您不使用plink.exe
使用Git for Windows附带的OpenSSH附带的任何二进制文件; probably it's ssh.exe
. 可能是ssh.exe
。 Export GIT_TRACE=1
before running git push
and see if it prints out anything hinting at what went wrong, like this: 在运行git push
之前导出GIT_TRACE=1
并查看它是否打印出任何暗示出错的内容,如下所示:
C:\\foo>GIT_TRACE=1 C:\\foo>git push ssh://git@server.com:/path/.git
我怀疑问题是用户'git'没有对远程存储库的写访问权限,并且您可能使用自己的用户名(cemurray或其他类似用户)手动连接。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.