0

1つのサーバーにgitリポジトリがあり、このリポジトリをリモートサーバーにプッシュできるという単純なシナリオを実装しようとしています。他の多くの問題を解決した後、私は次の段階で立ち往生しています。

server1には、gitリポジトリがあります。今、私はhttp://thelucid.com/2008/12/02/git-setting-up-a-remote-repository-and-doing-an-initial-push/で概説されている手順に従います

つまり、1)リモートサーバーへのssh 2)ディレクトリの作成3)リポジトリの初期化4)終了し、ローカルサーバーで次のステートメントを使用してリモートを追加します

   git remote add api User@example.com:/Myproj.git

5)リモートにプッシュします。(git push -u api master)

私が得るエラーは

git: '/Myproj.git' is not a git command. See 'git --help'.
fatal: The remote end hung up unexpectedly

これを修正する方法は?私はMsysGit1.7.10を使用しており、sshサーバーは両方のサーバーでCygwinです。

=======================

GIT_TRACE=2の出力を追加するgitpush-u api master

$ GIT_TRACE=2 git push -u api master
trace: built-in: git 'push' '-u' 'api' 'master'
trace: run_command: 'ssh' 'Administrator@api.example.com' 'git-receive-pack '\''
/Myproj.git'\'''
git: '/Myproj.git' is not a git command. See 'git --help'.
fatal: The remote end hung up unexpectedly

======================

GIT_TRACE = 2 git push -u api masterの出力(グローバルなgit config変更を行った後)

$ GIT_TRACE = 2 git push -u api master trace:built-in:git'push''-u''api''master' trace:run_command:'ssh''Administrator@api.example.com''git receive- pack'\''/MyProj.git' \'''致命的:' /MyProj.git'はgitリポジトリではないようです致命的:リモートエンドが予期せずハングアップしました

4

1 に答える 1

2

必要なのは、スラッシュを削除して実行することだけだと思います。

git remote add api User@example.com:Myproj.git
于 2012-07-23T19:32:18.513 に答える