1

Windows コンピューターからプッシュしようとするときに、テスト サーバーに git リポジトリをセットアップしようとしています。

git push ssh://git@server.com:/path/.git

エラーが発生します

fatal: The remote end hung up unexpectedly

しかし、サーバーに ssh して、まったく同じコマンドを実行しようとすると、問題なく動作しました。これは、私の git セットアップの問題ですか、それとも Windows セットアップの問題ですか?

4

2 に答える 2

4

The problem might be caused by a number of issues:

  • Git is installed in some weird place on the server, and the environment that "git" user gets when being logged in interactively (you do this by hand via PuTTY or whatever) differs from the environment it gets when being logged in non-interactively (the git client does this for you). This is because Unix shells read different startup files in these cases, and when git uses SSH to spawn remote git instance it still spawns the default (for the user) shell on the server.
  • You have a local problem (say, you configured Git to use 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).

In any case, try these steps:

  1. Run plink.exe git@server.com "git --version" and see it's able to run Git on the server at all. If you don't use plink.exe use whatever binary is shipped with OpenSSH included with Git for Windows; probably it's ssh.exe.
  2. Export GIT_TRACE=1 before running git push and see if it prints out anything hinting at what went wrong, like this:

    C:\foo>GIT_TRACE=1
    C:\foo>git push ssh://git@server.com:/path/.git
    
于 2012-05-04T12:13:30.390 に答える
0

問題は、ユーザー'git'がリモートリポジトリへの書き込みアクセス権を持っていないことと、自分のユーザー名(cemurrayなど)を使用して手動で接続している可能性があることだと思います。

于 2012-05-04T03:45:13.220 に答える